- Home /
SendMessage to another specific GameObject?
Hello,
I am looking for a SendMessage method that allows me to send a message with paramters to a separate game object. For example, a cube sending an int to a cylinder object... I guess each game object has to be identified by a tag or something which you can use to send a message to only that object.
How do you do it though? SendMessage/BroadcastMessage seems to only be to other scrips within the -same- object.
So long as you have a reference to the object you want to send a message to, Send$$anonymous$$essage can be called on any object you like!
Answer by softrare · Nov 30, 2011 at 02:59 PM
GameObject go = new GameObject();
int i = -1111; go.SendMessage("functionName",i);
This does not appear to work on completely separate gameobjects..
Your answer

Follow this Question
Related Questions
A node in a childnode? 1 Answer
SendMessage Slows down Unity Dramatically 3 Answers
How to send a message across different scenes 1 Answer