Why do I get this error in such a simple script?

void OnTriggerEnter(Collider other) {

						other.attachedRigidbody.AddForce (0, 5, 0);
				
	}

Error: NullReferenceException: Object reference not set to an instance of an object
CyclonePushUp.OnTriggerEnter (UnityEngine.Collider other) (at Assets/Scripts/CyclonePushUp.cs:18)

Doesnt make sense. IT has a rigidbody and a collider :/. Thanks in advance

I suggest you Debug.Log(other.gameObject.name); to make sure it’s colliding with the thing you think it is.

Doesnt make sense. IT has a rigidbody and a collider :/.

I guess you are talking about the object on which the script is attached to.

This error occurs when there is no RigidBody attached to other Object. Attach Rigidbody to the Object you are colliding with the script Object.

You are not checking that “other” is the correct object. Maybe there’s another object with a collider there.