Game Development Community

Collision isn't working as expected...

by Brandon Fogerty · in Technical Issues · 06/02/2008 (7:42 pm) · 3 replies

Hi guys. I am trying to simulate traffic in my game. Anyways I have two way points which are the Torque Logo models. One of the Torque logo models is called "T1" and the other "T2". The car will start from T1's position and once it collides with T2, it will start back at T1's position again.

T1 and T2 belong to the TorqueLogoitem datablock.
To test collision, I implemented the TorqueLogoItem::onCollision method.
Long story short, when ever there is a collision with one of these 2 models, I want the console to print out the name of the model which the car collided with as a test. However whenever I run this example, it only works when the car collides with T1. I know that the car collides with T2 as well because I can see visually that the car passes through T2 as well. However Torque doesn't seem to fire the onCollision event when the car collides with the T2 model. Again T1 and T2 both belong to the same datablock so it was my assumption that the TorqueLogoItem::onCollision method would be fired when ANY object collides with another object that is linked with the TorqueLogoItem datablock. Am I wrong?

Have any of you run into this problem? Thanks!

#1
06/03/2008 (6:42 am)
Does my question make sense or should I explain it better? This is a torque specific question. I am not sure why only one object out of 2 that are tied to the same datablock seems to fire a onCollision event when something collides with it. Why doesn't the other object fire the onCollision event when it has been collided with as well?
#2
06/20/2008 (8:32 am)
Hi! I am new but maybe you need to name the both logos with same word.
#3
07/26/2008 (10:09 pm)
What's your onCollision method? It does seem strange that one object oes not register the collision. Are there any other differences between the two objects, aside from position?