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

Camera Facing Wrong Direction With Scriptable?

The goal of this script is to set the camera to put the "Focuspoint" on the center and have it face the part from straight on.

I currently have:

repeat wait() until game:GetService('ContentProvider').RequestQueueSize == 0

Focuspoint = workspace.Lobbys:WaitForChild(game:GetService('Players').LocalPlayer.Name.."'s Lobby").Stage.Focuspoint

local cam = workspace.CurrentCamera
cam.CameraSubject = Focuspoint
cam.Focus = CFrame.new(Focuspoint.Position)

wait()
cam.CameraType = Enum.CameraType.Scriptable
cam.CoordinateFrame = CFrame.new(0,9.2,0)

The camera looks to the right at a 90 degree angle from the center, and using cframe.angles doesnt help with that issue

3 comments

0

Just reduce the distance yourself. Instead of Vector3.new(0, 9.2, 0), do Vector3.new(0, 5, 0) or something smaller instead.

0

If you just want it 5 studs above FocusPoint then CFrame.new( Focuspoint.Position + Vector3.new(0, 5, 0), Focuspoint.Position) would probably do.

1 answer

✓ Accepted answer

Remove lines 05-09. That's going to be ignored by setting the CameraType to Scriptable anyhow.

As for line 11, you can construct a CFrame starting at Vector3.new(0, 9.2, 0) looking at Focuspoint.Position with CFrame.new( Vector3.new(0, 9.2, 0), Focuspoint.Position).

2 comments

0

its a bit far away from the object, how do i set it to be closer

0

setting it to 5 makes it look to the side

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