My character's camera goes beyond the walls

Lately I’ve noticed that the Rig of a character in our game has had discrepancies in some walls, this usually pass through them with the camera and begins to interact with what is inside it, for now as the game has few players no one has noticed it, but I would like to know what is the solution to this?

According to what I could analyze maybe it is something related to how the Rig of my character is constituted, it is R15, it has a complete custom animation package.

But if it were not for that, then I would not know what is happening, if someone can enlighten me it would be of great help, thanks!

1. Camera Clipping Through Walls

  • Problem: Roblox’s default camera can clip through walls if there’s not enough distance between the camera and the player’s character (especially in third-person view).
  • Why: The camera doesn’t always respect wall collisions unless customized to do so.
  • Signs: The camera passes through walls, shows interiors, or reveals areas that should be hidden.

2. Custom Animations Moving the Rig Too Far

  • Problem: Your custom animation package might move limbs or body parts beyond expected positions, pushing parts of the rig (or camera if attached) through walls.
  • Why: Especially true for exaggerated poses like leans, stretches, or jumps.
  • Signs: Happens more often during certain animations (running, climbing, dancing, etc.).

3. Collision Group Issues

  • Problem: Your character might be using a collision group that doesn’t collide with certain walls.
  • Why: You might have changed collision settings for smoother movement or interactions.
  • Signs: Happens with some objects but not all.

4. Camera Subject Offset or Custom Camera Scripts

  • Problem: The camera may be offset too far from the HumanoidRootPart, or a script may be placing it wrongly during runtime.
  • Why: Custom camera scripts or buggy camera modes.
  • Signs: Changes after respawn, zooming, or switching views.
1 Like

:white_check_mark: Possible Solution

To prevent the camera from going through walls, you need to implement camera collision with raycasting.

Can you at least paraphrase what AI gave you before sending it out? Thanks.

You can try lowering the zoom distance of the camera, if that doesnt work, implement raycasting for wall detection.

Or probably a less efficient approach, check if the character is in view of the camera, if it isn’t, don’t let the player pick up items.

1 Like

The problem of not being able to move the camera would be a problem for the playability of my game, the only accurate thing that Chat GPT said above, was that maybe the solution is to implement a raycast system, I tried those walls with the normal roblox rig and it doesn’t happen, so I wouldn’t be understanding why it happens.

Also to implement a different spawn and not being able to grab the tools if this character is not seeing would be a very unoptimal solution indeed, also to change the spawn of the tool once you have done the puzzle that unlocks them would be to redo the system back from 0 and we would lose a lot of time developing it, until now I stay with the Raycast, but I also evaluate new solutions.

I mean, the roblox camera is optimised for roblox characters.
So if you are implementing a custom character, the roblox camera might not be the best fit.

no it still happens with normal roblox rigs, usually with shiftlock or special angles, piggy for example, where you can grab keys though boxes, the same issue your experiencing, but sure, it happens more rarely than custom characters.

I guess just stick with the raycast, im not sure what other method there might be.
As when I make custom camera systems, my go to solution is raycasting, your choice though.

1 Like