Hi everyone, first time poster here.

I am developing a third person shooter in Godot 4.1. I have a offset camera following my player at all times and it's working as expected except for when the player is in front of a wall. The SpringArm3D always seem to clip through the wall at some particular angle. I have first tried to change the arm length but it doesn't seem to be the problem. So far making the player's CollisionShape bigger or centering my camera solves the issue, but those are not ideal for my game.

Here's how it look like:

Wall behind player, not clipping

Wall behind player, clipping

View from above, not clipping (added a sphere at the SpringArm3D detect point for visibility)

View from above, clipping

Here is what my tree looks like:

And, here is the code for the CameraController script.
func _input(event):
if event is InputEventMouseMotion:
rotation.y -= event.relative.x / 1000 * sensitivity
rotation.x -= event.relative.y / 1000 * sensitivity
rotation.x = clamp(rotation.x, deg_to_rad(-50), deg_to_rad(89))

Anyone knows what is going on here? Any help would be greatly appreciated. Thanks!

It can be a problem relate with the position of your nodes in the 3D space:
Check if CameraController is positioned at "sprite neck"
(x:0m-y:1.5m-z:0m; This is the "neck" position of my sprite located at 0,0,0)

    fatalox Thanks for the reply.

    I have repositioned my nodes correctly, double-checked everything but it sadly didn't solve it.

    The only temporary work-around I have found is to center the CameraController and its children behind the player; on
    the X and Z axis. I have also scaled up the player's collision box so the player does not clip through the wall. It helped but there is still some clipping occurring with the walls and the floor.

    I have imported Godot's TPP demo project (https://github.com/godotengine/tps-demo) and played a bit with it. I did a test and put a offset to the SpringArm and it didn't clip like in my project. I have also noticed that the camera node structure is set differently (one for Y rot, one for X rot) ... maybe I should try that.

      fatalox placing the CameraController inside the Player Node3D?

      This would be a best practice.

      quickben
      This is almost identical to what I am experiencing! It occurs at the same angles.

      I will try and make the camera a child of player like the others have suggested. Meanwhile, I am going use a larger collider box for my player and my walls until this issue gets fixed.

      Thanks for the help everyone.