Jump to content

Editor children can not be found with Lua


Recommended Posts

I have a Pivot with a camera as child. This is done in the editor.

post-45-0-72762800-1371053896.jpg

 

When I attach a script to the Pivot with the following code in the start function, it tells me that are no children:


function Script:Start()

--Count children
count = self.entity:CountChildren();
System:Print(count)

--Find the camera child
camera = self.entity:FindChild("camera")
if camera == nil then
System:Print("Camera child not found")
end
end

 

If I do this with C++ then it does work. It will tell me that there is one child that I can also access by name.

Link to comment
Share on other sites

Yeah, we worked around this. I hate saying that because I don't want Josh to think it's not important then that he fix it asap because this is a pretty basic feature of the editor. :)

 

Will need to test if getting the parent works as I'll need that.

Link to comment
Share on other sites

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

×
×
  • Create New...