Collision Problem
by Tom Perry · in Torque Game Builder · 01/27/2009 (2:56 am) · 2 replies
Hello everyone.
I'm having some problems with collision in TGB. I have a football/soccer scene set up, with the ball and the players represented as circles. All the players and the football send and receive collisions, and their collision responce is set to rigid. They all have a circle collision shape.
The collisions all worked perfectly when nothing was going on, I've I just had a player move towards the ball the ball would act as you'd expect. However now I have AI routines etc going on in the background sometimes the collision is completely missed...the player just walks over the ball. I have debugged, the "onCollision" callback is not getting fired everythe the player collides with the ball. It makes me think that sometimes the engine misses the collision...? It is quite temperamental, sometimes it works, sometimes it doesn't. Has anyone seen this, and more importantly does anyone know of a way to fix it?
Thanks a lot.
I'm having some problems with collision in TGB. I have a football/soccer scene set up, with the ball and the players represented as circles. All the players and the football send and receive collisions, and their collision responce is set to rigid. They all have a circle collision shape.
The collisions all worked perfectly when nothing was going on, I've I just had a player move towards the ball the ball would act as you'd expect. However now I have AI routines etc going on in the background sometimes the collision is completely missed...the player just walks over the ball. I have debugged, the "onCollision" callback is not getting fired everythe the player collides with the ball. It makes me think that sometimes the engine misses the collision...? It is quite temperamental, sometimes it works, sometimes it doesn't. Has anyone seen this, and more importantly does anyone know of a way to fix it?
Thanks a lot.
About the author
#2
I did some more digging. When it happened I outputed the collision variables of the ball and player involved using the console. Each time either the football's collision or the players collision had been turned off. I now set the collision to true on both the football and the players periodically (using a timer, evey 50 ms or so) and I havn't had a problem since; even on an older, less powerfull laptop.
I have no idea what was making the collision turn off, and why it happened so randomly!
01/28/2009 (9:25 am)
I havn't checked the Max Collisions, so it is set to whatever the default value is. Physics was set also.I did some more digging. When it happened I outputed the collision variables of the ball and player involved using the console. Each time either the football's collision or the players collision had been turned off. I now set the collision to true on both the football and the players periodically (using a timer, evey 50 ms or so) and I havn't had a problem since; even on an older, less powerfull laptop.
I have no idea what was making the collision turn off, and why it happened so randomly!
Torque Owner Nic Biondi
Default Studio Name