Search the Community
Showing results for tags 'functions'.
-
Hi Leadwerkers, I have a problem. I would like to load my player prefab file, when the map loads and put it to a specific position. So I created a script for that. It loads my player prefab on start. The problem is, the Start function of its entities does not get called. I was able to fix it in a way but I still have a porblem. I told my main player script to call the Start functions of every childs script. The problem is some childs have childs aswell, and this child have other childs and so on. So why do the Start functions not work if I load a Prefab of my player which has many childs? Is there any fix? Suggestions? Am I doing something wrong? Or how to access every! child, and the childs of the childs etc of a singel entity, to then call the start function. I could make a ridiculous amount of loops, but thats pretty unefficent and stupid. Thanks for the help, Mad Morra
- 5 replies
-
- Start Function
- Functions
-
(and 1 more)
Tagged with:
-
function Script:CreateNewParent(pName,x,y,z) self.parent(pName)=nil self.parent(pName) = Model:Box() self.parent(pName):SetPosition(x,y,z) end I think its self explaining, I want to make my script more optimized so how do you make a new object with a pName as name?