Ok, since i am pretty new to unity (just 30 days and counting) and i am trying to start a decent project I’d have a couple of questions for you, and sorry if they sounds too noobish.
- I have a GameObject, let’s call that House1 and I want to send all childrens a message, or tell them to execute a function
- In this GameObject, i want to execute a code for every child in this object parent ( I know how to use loops, etc, it’s just the way to know how many childs has the script parent that i don’t know)
Pseudocode:
var thisObject :GameObject
function Start()
{
thisObject = ThisScript.parent
}
function Update()
{
thisObject.SendMessage("newHouseCreated")
for (i = 0; thisObject.childCount > i; i++)
{ //See N°2 in the post, if you skipped it
executethatcode
}
}
Thanks for any help
EDIT = corrected the pseudocode
Philip