How would I have a CameraOffset that doesn't go through Parts while having the Character Visible?

Hi,

So I want to make a Fist Person View of the Players Character, I already know how to do this with LocalTrasparencyModifier and with a for loop to get all the BaseParts , But setting a Camera Offset has a effect where it goes through Parts and walls at all. which is not what I want.


I have tried:

  • Using a Part and Setting the Offset to the Parts Location
    This still makes the Camera go through parts since its constantly Setting the CFrame in front of the Character

  • Creating a Constraint
    This had the unintended effect of flinging the player, but I fixed this and it works, however it interrupts the Players fall since the Part is CanCollide true to prevent the Camera from going through the Part.


My thoughts were to use a Ray cast or Magnitude (might be same thing), but I’m not sure if that will lag the Server (Or Client) due to it Constantly firing with RunService.RenderStepped, or if i use Raycast.Position + RayCast.Normal, if I even use those.

How should I go about in making this?

Assume that the first person camera position never causes clipping through walls, which is what most games assume. Now you can use raycasting to check if the camera can “slide” to the offset position. If it hits any parts (not including the player), stop it there instead of going all the way.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.