Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How to change the cameras offset?

Asked by 5 years ago

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)
0
so are you saying you have like a part next to the character, and you want the camera to focus on that part? greenhamster1 180 — 5y
0
no the player floats in the air and a part is welded to your character and moved below you imnotacoder 13 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

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

Ad

Answer this question