How would I go about making a shoulder-offset 3rd person Camera Boom

I need some guidance on how I could make a functional camera boom, because currently im using humanoid camera offset to offset the camera to a third person POV but it creates the issue of being able to look through walls VERY easily, and I dont want to make a system that blinds or blackboxes the camera if its not directly seeing your character.

Perhaps try this (immensely harder and buggier if you want to use humanoid.CameraOffset):

  1. Get the head position and the camera position
  2. Subtract the head position from the camera position to get the direction
local direction = head.Position - camera.CFrame.Position
  1. Cast a ray (raycast) with the head as the origin and a direction of the direction we calculated in the previous step
local result = workspace:Raycast(head.Position, direction, raycastParams)
  1. Check if there is a raycast result. If there is, set the camera position to the raycast result position
if result then
    camera.CFrame = CFrame.new(result.Position) * camera.CFrame.Rotation
end
1 Like

@DurinzTheThird_2 It’s been 5 days and I see that you’ve liked it. Have you tried an implementation of this yet? Also, this should be in Help and Feedback > Scripting Support.

1 Like

Oh I have not haha, I’ve been busy with a vacation and another function meant for this, I doubt ill get around to implementing this.

1 Like