In discrete physics engines, bullet colliders frequently pass straight through walls at high speeds without triggering a hit callback. This occurs because the physics solver samples positions at discrete intervals. If a bullet travels 25 meters per frame and a brick wall is 0.5 meters thick, the bullet teleports across the wall between frames without ever colliding.
1. Continuous Collision Detection (CCD) vs Raycast Sweeps
For fast player movement or medium-speed cannonballs, enable Continuous Collision Detection (CCD) in your rigid body settings. Rather than checking overlapping spheres at point A and point B, the engine sweeps a convex hull along the motion trajectory.
2. The Bullet Raycast Sweep Solution (Godot / Unity)
For ultra-fast sniper bullets and lasers, do not use rigid body physics at all. Use a per-frame Raycast sweep:
// Bullet Raycast Sweeping in GDScript:
func _physics_process(delta: float) -> void:
var move_step = velocity * delta
var next_pos = global_position + move_step
var space_state = get_world_3d().direct_space_state
var query = PhysicsRayQueryParameters3D.create(global_position, next_pos)
var result = space_state.intersect_ray(query)
if result:
# Collision guaranteed! Cannot tunnel through walls
spawn_hit_spark(result.position, result.normal)
queue_free()
else:
global_position = next_pos