mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
fix: NRE in tanks example when running in headless server only (#2326)
This commit is contained in:
parent
5db733e566
commit
6e44e6e526
@ -35,9 +35,12 @@ 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)
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user