Godot Version
4
Question
I have a ray cast attached to my camera attached to a vehicle. The ray cast is for picking up stuff in the vehicle like the rigid body capsule I made and the ray cast works fine except when the vehicle is moving. The get collider function on the ray returns either the collider of the vehicle or object null when moving forward in stead of the object I’m trying to pick up and sometimes works when moving backward.
sounds like:
1 - a parenting problem. make sure the raycast moves with the player.
2 - a detection problem. maybe a ray is too thin for this. try using an Area3D. it will grab things in a wider area.
3 - a collision problem. your ray and player should be preferably in different layers, so the player is ignored by a raycast that is parented to itself.
you can enable collision debug to see where the colliders are and what the problem is.
Hi, can you give a little bit more information? Like your code or something