hello, i have an upgrade in my game where the ball is attracted to the bat but the force is not being deleted
heres the code:
if PowerUp_Magnet.flag2 = 1
if timer() - PowerUp_Magnet.time2 < 20
if PowerUp_Magnet.done2 = 0
SetSpriteColor ( BatLeft.spr, 255, 0, 255, 255)
PowerUp_magnet.effectID2 = CreatePhysicsForce ( GetSpriteXByOffset ( BatLeft.spr ), GetSpriteYByOffset ( BatLeft.spr ), 50, 0, 50, 0)
PowerUp_Magnet.done2 = 1
endif
SetPhysicsForcePosition ( PowerUp_magnet.effectID2, GetSpriteXByOffset ( BatLeft.spr ), GetSpriteYByOffset ( BatLeft.spr ))
else
DeletePhysicsForce ( PowerUp_magnet.effectID2 )
SetSpriteColor ( BatLeft.spr, 255, 255, 255, 255)
PowerUp_Magnet.flag2 = 0
endif
endif
i know that it is getting to the else stage as SetSpriteColor is working. any ideas why it isn't deleting?