Collisions being called . . . then called again . . . and again
by Kevin James · in Torque Game Builder · 06/11/2007 (9:19 am) · 2 replies
Here's my problem:
I have a projectile that is shot out from a player's ship. When this projectile hits the enemy I want it to be gone, the first time. Currently, I have the projectile's collision detection mode set to kill, and yet the callback is ran through maybe twenty or more times before the particle is killed. The higher the fps, the more times the callback is called, the slower the fps the less times it is called. This is a very major problem that I must fix!
I've had similar problems with previous projects. Suggestions would be great!
I have a projectile that is shot out from a player's ship. When this projectile hits the enemy I want it to be gone, the first time. Currently, I have the projectile's collision detection mode set to kill, and yet the callback is ran through maybe twenty or more times before the particle is killed. The higher the fps, the more times the callback is called, the slower the fps the less times it is called. This is a very major problem that I must fix!
I've had similar problems with previous projects. Suggestions would be great!
About the author
Computer security, digital forensics, and platform jumper enthusiast. shells.myw3b.net/~syreal/
#2

This alien also thanks you. The player fire now does 5 damage like it is supposed to, instead of 535.
06/11/2007 (11:27 am)
Wow Matt, I wasn't expecting it to be that easy! setEnabled works like a charm! What messed me up is that yesterday I tried using safeDelete, but that doesn't work for whatever reason.
This alien also thanks you. The player fire now does 5 damage like it is supposed to, instead of 535.
Torque 3D Owner Matthew Langley
Torque
in the onCollision callback set it to setEnabled(false) and see if that works.