x


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);

}
more ▼

asked Sep 27 '11 at 02:59 PM

haroonalam gravatar image

haroonalam
50 25 35 36

(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x4142
x3721
x2485
x334

asked: Sep 27 '11 at 02:59 PM

Seen: 1074 times

Last Updated: Sep 27 '11 at 02:59 PM