Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

BroadcastMessage to children only?

Discussion in 'Scripting' started by Spacemonkey, Aug 12, 2009.

  1. Spacemonkey

    Spacemonkey

    Joined:
    Oct 24, 2008
    Posts:
    89
    Yello,

    Like the title says, I'm looking for a way to have a message sent to the children of a gameobject but not the gameobject itself. I'm trying to trigger an event when the child collides with an object in the scene, but with BroadcastMessage both the parent and the child will trigger the event and that's no good. Anyone able to help out?
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    broadcast message to children sounds like you want to use sendmessage
     
  3. Spacemonkey

    Spacemonkey

    Joined:
    Oct 24, 2008
    Posts:
    89
    Ah, got it working. Thanks for the help :)