Area3D not colliding wiith staticBody3D

Godot Version

v4.4.1.stable.official

Question

Currently trying to get bullets in my game to collide with the environment. They collide with enemies but not the floor or walls.

Here’s the bullets code, tree and inspector bullets are on collision layer 6 with walls and floors on 3

func _on_body_entered(body: Node3D) -> void:
	#debug body
	print("hit: " + str(body))
	
	#check for damage function in body
	#set position for range calc
	#calculate damage using the range on the curve
	#deal damage to body
	if "hit" in body:
		position = body.get("position")
		shot_range = (position-starting_pos).length()
		final_damage = damage * damage_dropoff.sample(shot_range / bullet_range)
		#debug damage
		print("damage=" + str(final_damage))
		
		body.hit(final_damage)
	#delete bullet
	queue_free()

Bullets:


Walls and Floor:


Please let me know if any additional info is needed thank you for the help.

There can be a few reasons why this happens, but based on your screenshots I can offer a few things that might help.

For one, I’m sure you already have, but make sure that your “Area3D” has monitoring set to true, so it can monitor bodies entering and exiting it.

Next, if your Wall is the CSGBox3D, then make sure it has use_collision ticked, and have it’s layers and mask set correctly.

If your MeshInstance3D has anything to do with the walls, make sure it has a Mesh attached to it, then generate a CollisionShape based on it by clicking here:
image
This goes for both the bullet itself and the Floor.

Hopefully one of these will help!

1 Like

If you are using Jolt physics then you need to explicitly enable this interaction. More info here Using Jolt Physics — Godot Engine (stable) documentation in English

1 Like

Thank you that seemed to do the trick really appreciate the assistance.