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

How do you make the camera first person mode and follow a part?

Asked by 10 years ago

I'm trying to make the camera follow a moving part without having the angle of view change (or in other words, have the CoordinateFrame of the camera change with the part). I also want it to be first person mode, so that the user cannot zoom in or out.

Some context: The coordinate frame value is set to a value. The CameraType is set to Follow The Player.CameraMode is set to LockFirstPerson The CameraSubject is set to the part in question

I know that setting CameraType to Custom lets first person mode work, but the location of the camera doesn't change. The camera moves to follow the part, but doesn't move with the part, if that makes sense.

1 answer

Log in to vote
0
Answered by 10 years ago

I think that Focus property works fine with custom camera type and first person, so you'd do:

camera.Focus = CFrame.new(part.Position)

If doesn't work, you might aswell just use the camera's CFrame. Not sure why you didn't want to use it in first place:

camera.CoordinateFrame = CFrame.new(camera.CoordinateFrame.p, part.Position)
0
I did use CFrame. I said it in the question, but my problem is that the camera always points correctly but wont move correctly. socccerstar 5 — 10y
Ad

Answer this question