Broadcast Message Not Working

Hi everyone, I have a problem with broadcasting message. Even when I put in the receiver script in its’ child, unity still tells me “BroadcastMessage has no Receiver!” error, so my scripts don’t work as well.

Here is my code on the parent:

    public void SetPlayerName(InputField playername)
    {
        this.playername = playername.text; //this.playername is where I store the name data
        BroadcastMessage("SendName", this.playername, SendMessageOptions.RequireReceiver);
    }

Here is my receiver code in the child script:

    void SendName(string playername)
    {
        this.playername = playername;//this.playername is another string variable where I store my playername data in the child
    }

And I’m sure I put the receiver gameobject as the broadcaster’s child.

130074-helpme-unity1.png(Tank is the parent, and PlayerInfos is the child).
Can anyone help me with that?

I don’t think you need the “this” everywhere. Also, try making your function public.

    public InputField playerName;

    void SetPlayerName()
    {
        //called when the inputfield has been modifed from the UI
        BroadcastMessage("SendName", playerName.text,SendMessageOptions.DontRequireReceiver);
    }

//function on children
    public void SendName(string name)
    {
        //do stuff
    }