Game Development Community

RigidShape collision callback not being called

by Patrick Webber · in Torque 3D Professional · 03/30/2013 (3:36 pm) · 3 replies

Hi all,

I've been working on a spell system, which is mostly functioning. To try and get the spells to have collisions similar to the effects I hide a collision object (rigid shape) that travels along with the visual effect. I've gotten to the point where I want spells to start affecting the environment around them. For example, a fire spell should be able to light a campfire when it collides.

To setup my project I added in a permanent velocity value to rigid shape which then uses it to simply update the momentum/velocity each tick. I also removed gravity updates so that it won't fall when the spells move slowly. When spells are cast, they react to collision in the environment normally. They can slide along the ground and run into objects. The problem is the on collision callback isn't happening.

I have the datablock's callback setup to remove the effect and collision object on collision.

Players running into spells or spells running into players (or A.I. players) causes the callback to occur, but nothing else. Another issue is that rigid shapes seem to completely ignore collision of other rigid shapes (they fly through each other).

Does any body have an idea as to what might be going on or perhaps where I might have broken it?

Thanks,
Patrick

About the author

I'm a computer science major at Stony Brook University, and have been working with the Torque Game Engine for a number of years.


#1
04/06/2013 (1:10 pm)
Hi, I'am having a smilar issue. My rigidshape bounces but my player goes through...
Did you get your answer?

Thanks,
Michael
#2
04/06/2013 (5:19 pm)
For the callbacks that I was missing, I used onImpact rather than onCollision.

The two rigid shapes running through each other is because of the custom movement stuff I wrote in them. The callback for onImpact work, but the movement causes them to fly through. Luckily all I really needed was the onImpact stuff.

Hope this helps.

-Patrick
#3
04/07/2013 (11:02 am)
Always refer to the source. Callback names vary (as Michael noted), the collision masks may vary (so you need to ensure they are masked to collide with the objects you want).