- Home /
Question by
haroonalam · Sep 27, 2011 at 02:59 PM ·
c#collisionontriggerenter
Multiple collisions not working.Plz help
Hello I am new in unity. I am experimenting collision detection using onTriggerEnter. On collision with other object(tower) direction changes and object moves. I have created one more similar object (tower) and placed both far from each other. Now for the first collision it is working fine, but at other collision it is not working, if I placed both closer to each other it works! .. I am unable to understand this phenomena, pl help Here is my code:
void OnTriggerEnter(Collider obj) {
collideCount++;
Debug.Log(collideCount);
Quaternion target = Quaternion.Euler(0, 90, 0);
tf.rotation = Quaternion.Slerp(tf.rotation, target, Time.deltaTime * speed);
tf.Translate(0,6,0);
}
Comment
Your answer
Follow this Question
Related Questions
Weirdest Collision EVER 1 Answer
How to check if an object is colliding with another from another script ? 1 Answer
Distribute terrain in zones 3 Answers
Collision problem in C# 4 Answers
OnTrigger problems 2 Answers