Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to change the cameras offset?

I am making a script where it moves the player up and creates a separate, unkillable, player model below them but the problem is the camera is focused on the player, not the player model I have tried camera manipulation but it would unfocus on everything and be stuck looking at the ground. I am trying to make a way to focus on the new player model but still be able to move the camera. To try and solve the problem I used Humanoid.CameraOffset but nothing would happen if I tried to use pcall to find the error it would return successful

wait(5)
Hum.CameraOffset = Vector3.new(0, -18, 0)

2 comments

0

so are you saying you have like a part next to the character, and you want the camera to focus on that part?

0

no the player floats in the air and a part is welded to your character and moved below you

1 answer

✓ Accepted answer

You can use this property to focus the camera on the clone: https://developer.roblox.com/api-reference/property/Camera/CameraSubject So, from a LocalScript, it would look something like this:

function FocusToClone(Part) -- This function will attach the camera to Part
workspace.Camera.CameraSubject = Part
end
function ReturnFocus() -- you can use this to put the focus back on the player's character
workspace.Camera.CameraSubject = game:GetService('Players').LocalPlayer.Character.HumanoidRootPart
end

Please accept this answer if it helped you solve your problem

This discussion is preserved as it was. New answers, comments, and votes are closed.