I have a projectile weapon that works great but if I back up at a certain distance, the bullet.instance seems to stop registering collisions with everything.
here's the code for the bullet. If you think the problem is in the weapon itself I can share the code for it too.
extends RigidBody
var shoot = false
const DAMAGE = 50
const HEADSHOT_DAMAGE = DAMAGE * 2.5
const SPEED = 10
func ready():
setas_toplevel(true)
func physicsprocess(delta):
if shoot:
apply_impulse(transform.basis.z, -transform.basis.z * SPEED)
func onAreabodyentered(body):
if body.isingroup("Enemy"):
body.health -= DAMAGE
queuefree()
else:
queuefree()