Raycast Physics Issues

Godot 4.3
I am trying to make an FPS type 3D game based off a bunch of different tutorials. I am very new to coding, modeling, game dev, the whole nine. Just picked it up as a random fun project. The issue I am currently having is it seems like my raycast (called aimcast in code) is not colliding correctly with about…half? of my world scene.
I have tried to add more enemies and I was unable to hit them, and half of my “spark” effects for bullets hitting things do not show, or appear in the center of my level.
This is the code from my FPS Controller, the level is just built off CSGBox3Ds that have been duplicated in either a 2x2x2 size or 1x1x2 size.





Seems like you are duplicating the raycast’s work by using intersect_ray. You could get the colliding target with aimcast.get_collider(). Your ray query is probably causing the issue as the start point is using a local-space muzzle position, rather than global position, again make use of the ray cast’s get_collider() function instead of this.


Make sure to paste scripts instead of screenshots