Raycast skipping through some bodies, despite being on the same mask and labor

Godot Version

4.3

Question

Hi! I’ve been developing a system to handle the “step” noises in my project. I shoot a ray cast to the foot of the entity and then access its material to determine what sound to play. I happen to use a terrain addon (terrain_3d by Tokison Games) , and I was able to write a method that works with the terrain perfectly; however, for some reason whenever the player is on a surface that isn’t part of the terrain generation, the Raycast passes straight through the bodies of that object and registers the surface below it. I have verified that the objects are on the same layer and mask as the Raycast. I genuinely have no clue why it would pass through, I have the Raycast set to collide with both areas and bodies.

I’m not sure how helpful this is, but here’s the code that determines which method it uses to access the collider.

func find_step_sound():
	var floor = material_checker.get_collider()
	if floor.get_class() == "Terrain3D":
		floor_texture = terrain_texture_access(floor)
	else:
		floor_texture = object_texture_access(floor.find_child("MeshInstance3D"))

and here are the two methods in question, but currently only the terrain one triggers

func terrain_texture_access(terrain : Terrain3D) -> String:
	var terrain_id : int
	var terrain_composite : Vector3
	terrain_composite = terrain.storage.get_texture_id(GlobalData.player_position)
	if(terrain_composite.z >= .3):
		terrain_id = terrain_composite.y
	else:
		terrain_id = terrain_composite.x 
	match terrain_id:
		0:
			return "rock"
		1:
			return "snow"
		_:
			return "snow"
func object_texture_access(colider : MeshInstance3D):
	var texture = colider.get_active_material(0)
	print("texture", texture)
	return colider.get_active_material(0)
	

Any help would be much appreciated. Its probably just a setting option I am unaware of. Thank You!