- Home /
Question by
nanu2000 · Aug 15, 2014 at 10:10 AM ·
(C#)OnTriggerEnter collider only works on one game object.
Heres my code.
void OnTriggerEnter(Collider UpdraftGOS)
{
if (UpdraftGOS.gameObject.tag == "Updraft1") {
Updraft1 = true;
UpdraftGOS.gameObject.SetActive(false);
}
}
Comment
I assume you have a Rigidbody on one of the objects, have you tried adding a Rigidbody to both objects?
found it out guys, turns out Im an idiot, its a 2d game and the object was in a different place on th Z axis.
Your answer
Follow this Question
Related Questions
No Overload for method 'Instantiate' takes '7' arguments? 4 Answers
How to add collision detection between two game objects? 2 Answers
OnMouseEnter, change color. 1 Answer
Global name space error c# 0 Answers
SetActive() not working 2 Answers