SendMessage without Target

Hi,

I’m new to Unity…

My problem is that when I try to use the SendMessage(); method I cant recive that Message in any other Script. My call looks like this:

SendMessage("CallMe", object, SendMessageOptions.DontRequireReceiver);

If I call this from a Gameobject everything works fine. But without, nothing happens? No Error, no call.

When you use SendMessage, the function specified by the first argument is called in all scripts attached to the same object that sent the message - scripts assigned to other objects will not even hear about this message.

If you precede SendMessage with a component or object reference, the message is sent to all scripts attached to that object (and no others):

    // this instruction calls Jump in scripts attached to this object
    SendMessage("Jump"); 
    // but this calls Jump in all scripts attached to "target"
    target.SendMessage("Jump"); // target may be a GameObject, Collider, Transform etc.