9 - Player UI Prefab

Options
I have been following along with the official tutorial, using their assets, and I am getting an error that an object is not set to an instance of an object, when I click on it, it refers to these 2 instances of code in my PlayerUi script:
This in the update:
if (playerHealthSlider != null)
{
playerHealthSlider.value = target.Health; // Object reference not set to an instance of an object
}

and this in the SetTarget function:

if(playerNameText != null)
{
playerNameText.text = target.photonView.Owner.NickName; // Object reference not set to an instance of an object
}

Comments

  • Zigordion
    Options
    Ah nevermind i was setting the target to null rather than checking for it