- Home /
Send message to other objects in list
Hello everyone.
I have a game where the player can build structures out of different pieces. The player first builds the object then hits the "play" button and the structure turns into a rigid body. All objects stem from each other in a tree of parents so as to act as one big rigidbody. This makes it easier for the root object (lets call it the processor) to communicate with all the objects down the parent tree. To do this I use `transform.gameObject.BroadcastMessage` from the processor and it works great.
The thing is, for some special objects where they are actually connected to the parent tree though a hinge joint, they cannot be part of the parent tree or else they could not move freely as a hinge. The problem here is these objects don't receive the message from the processor because they are not part of the parent tree.
How can I make it so all the objects (including the attached rigid bodies outside of the parenting) receive the messages.
Thanks.