NullReferenceException Error (86376)

I get this error when I approach the object in game:

NullReferenceException: Object reference not set to an instance of an object
TerminalHack.OnTriggerStay (UnityEngine.Collider other) (at Assets/Scripts/Modules/TerminalHack.js:28)

function OnTriggerStay (other : Collider) {
			
	if (other.gameObject.tag == "Player") 

I changed something in the prefab now it seems to have broken a link. I don’t understand what has to be initialized. What to do? TIA

have you created a tag "Player" and assigned it to the gameobject

yes, that tag is already there.

1 Answer

1

I rebooted unity and that fixed it. I don’t know if that’s the correct answer.