GUI.Label() does not show up on WebPlayer

I’ve the following code snippets:


    void OnGUI()
    {
        GUI.Label(new Rect(10, 10, 500, 20), "MyLabel");
    }

It shows up on the Unity3D editor when I hit Play button. It works as expected.

I then Build it to a WebPlayer and run it on the Chrome browser. Everything shows up except the above GUI.Label.

What did I do wrong?

Thanks in advance for your help.

Nothing special about the above, so the problem is elsewhere. For example, are you using a particular font?

–

I just use the default. I do not use any skin/style.

–

2 Answers

2

I don't use the word new when I create a Rect.

This is C# so it requires new keyword.

–

My mistake. Sorry about that.

I forgot to copy the newly created .unity3d file.

I've debugged and as I suspected it changes to false when the human player passes his turn to the NPC turn. So I think I need to put this if: if(this.transform.position == targetPosition) { mov.NPCS[2].GetComponent<NPC>().isNPC = false; IsMoving = false; canMoveNPC = false; } Outside this: if (mov.gameManager.NPCTurn && canMoveNPC ) {// do movement stuff here

–