collider triggers
i'm trying to change a value on a component when the player collides with a cube but keep getting NullReferenceException: Object reference not set to an instance of an object levelup.OnTriggerEnter (UnityEngine.Collider item) (at Assets/levelup.cs:9)
when i use levelPlus1.rToG += (1); in void start it works fine
here is my code so far thanks for any help
using UnityEngine;
using System.Collections;
public class levelup : MonoBehaviour {
public levelup levelPlus1;
void OnTriggerEnter (Collider other) {
levelPlus1.rToG += (1);
}
}
Comment
Your answer
Follow this Question
Related Questions
OnTriggerEnter 1 Answer
Triggers Colliding With Triggers Not Working? [Solved] 1 Answer
Scripting Portal 0 Answers
Play other object's animation on camera trigger 0 Answers
Trigger and Rotation Issue 0 Answers