Hi guys !
I have a gun shooting a projectile on a moving target. Everthing is physics based. The projectile is set as a bullet (with setspritephysicsisbullet). It's initial velocity is set with SetSpritePhysicsVelocity and is around 300 per frame. The target has a max velocity of 120. I have this code running every frame for every bullet just before the sync() :
if GetSpriteFirstContact( bullet[i].sprid ) = 1
deletesprite( bullet[i].sprid )
bullet.remove(i)
dec i
endif
The code runs at 59.99 frame per second. 19 times out of 20, the bullet disappears as it should. But the rest of the time, the bullet bounces and doesn't disappear. The bullet bounces more often when the target and the bullet go in the same direction. What could be the issue ? Are my sprites moving too fast ?