Question by
nater1425 · Jun 02, 2016 at 10:46 AM ·
errorcollidertriggernullreferenceexceptioncomparetag
I have a code that changes my jump height but i keep getting a error: NullReferenceException: Object reference not set to an instance of an object JumpPad.OnTriggerEnter (UnityEngine.Collider other) (at Assets/scripts/JumpPad.js:10).
function OnTriggerEnter (other : Collider)
{
if (other.CompareTag("Player"))
{
GetComponent(character_code).jumpSpeed = 20;
}
}
Comment
Hi @nater1425, where did you attached this script. Did you check the player gameobject place in hierarchy? maybe give us a full screen shot or script(completed). This looks like you missed the gameobject to drag into your hierarchy.
Your answer
Follow this Question
Related Questions
trying to make a scare jump triggr but i get this error code 1 Answer
How to make an object move to the direction in which the user faces using vr gaze interaction? 1 Answer
Triggers colliding with triggers 1 Answer
What do i do if i have problems with tags? 1 Answer
Calling "OnTriggerEnter" when a parent object has a rigidbody 0 Answers