Skip to content

Commit

Permalink
fix: NRE in headless server mode
Browse files Browse the repository at this point in the history
  • Loading branch information
uweeby committed Oct 10, 2020
1 parent 967469f commit 6dc8406
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Assets/Mirror/Samples~/Tanks/Scripts/Tank.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ public class Tank : NetworkBehaviour

void Update()
{
nameText.text = playerName;
nameText.transform.rotation = Camera.main.transform.rotation;
if (!Camera.main)
{
nameText.text = playerName;
nameText.transform.rotation = Camera.main.transform.rotation;
}

// movement for local player
if (!IsLocalPlayer)
Expand Down

0 comments on commit 6dc8406

Please sign in to comment.