Jump to content

prefab doesn't work correctly if no start


Rick
 Share

Recommended Posts

I noticed that if a prefab doesn't have a Script:Start() function in the script no other LE script functions get called when I load a prefab. I assume if the 2nd param to Prefab:Load() indicates it should call the Start() function it tries to do so even if 1 doesn't exist, and bombs out or something. In my case I don't need a Start() function so I didn't have it in my script but I did have an UpdateWorld() function that turns the entity and I noticed my entity wasn't turning.

 

This isn't a huge deal as I can just add an empty Start() function but it was a little confusing as to why my entity wasn't turning. I have no need for a Start() function in this script so I shouldn't have to define one to make it work. Guessing it's just a function check in the Prefab:Load() to see if Start() exists and if not just skip trying to call it.

Link to comment
Share on other sites

  • 4 weeks later...
Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...