I have used broadcast message in my game before and it works just as it should.
So I added a new one that works te same way as the rest, but this one doesn`t do anything.
Here is my code:
//This is the broadcast
GameObject Controller = GameObject.FindGameObjectWithTag("GameController");
Controller.BroadcastMessage(j.ActionMethod,float.Parse (p.ActionParameter));
//This is the receiver
function Bulletin (BulletStr : String) {
ShowBullet = true;
BulletString = BulletStr;
}
//This is what it should do
function OnGUI(){
if (ShowBullet)
{
GUI.BeginGroup (Rect (Screen.width / 2 - 264, Screen.height / 2 - 106, 528, 212));
GUI.DrawTexture(Rect(0,0,528,212), TextBlock);
GUI.TextArea(Rect (16+8, 16+24+32,480,96), BulletString);
if (GUI.Button(Rect(8, 8+164, 512, 32),"I get it!"))
{
ShowBullet = false;
}
GUI.EndGroup ();
}
}
I don`t get any error messages, the other broadcasts work the same way and they work fine.
I tried your code but it didnt show me any mistakes. But i tried sending an integer as a parameter instead of a string, and it worked. I guess I cant send any strings with broadcast message. Perhaps you know why?
I maybe out of th subject, just in case, do you specifically want to use BroadcastMessage? Or any other way to speak to your function will match your needs?