Can the engine run onCollision() just once per collision?
by Nick Sandow · in Torque Game Engine · 01/22/2007 (8:19 pm) · 1 replies
Hi,
When Torque detects two ShapeBase objects have collided, it repeatedly runs a script hook, onCollision(), until the collision ends. (In fact, it runs the hook every CollisionTimeoutValue ms, where CollisionTimeoutValue is an enumerated constant in ShapeBase.cc).
Can the engine be configured to call onCollision() just once? In other words, I want onCollision() to run when the objects first collide, but not again until they have separated and recollide at a later time.
I want to play a sound when collisions occur. In the real world, you only hear one "bang" when things collide, not a bang every 250ms as is the case with the most naive implementation of my desired feature: sticking a call to serverPlay3d() in onCollision().
When Torque detects two ShapeBase objects have collided, it repeatedly runs a script hook, onCollision(), until the collision ends. (In fact, it runs the hook every CollisionTimeoutValue ms, where CollisionTimeoutValue is an enumerated constant in ShapeBase.cc).
Can the engine be configured to call onCollision() just once? In other words, I want onCollision() to run when the objects first collide, but not again until they have separated and recollide at a later time.
I want to play a sound when collisions occur. In the real world, you only hear one "bang" when things collide, not a bang every 250ms as is the case with the most naive implementation of my desired feature: sticking a call to serverPlay3d() in onCollision().
Associate Chris Haigler
Jester Dance