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

How would I rotate a players camera angle by 90 degrees?

Asked by 6 years ago

I'm not sure on how I would go about doing this. Here's a bit of a demonstration.

https://imgur.com/a/gV0Xw

Basically what I'm trying to do is when the player joins the game with the camera facing upwards, which is pretty simple. I'm not sure on how I would rotate the camera smoothly to face forwards. It sounds a bit wonky but the outcome will be quite a sight.

Anyone have any ideas?

P.S. I'm not asking for a full script, just where to look.

1 answer

Log in to vote
0
Answered by
cabbler 1942 Moderation Voter
6 years ago

Step 1: Decide goal cframe... offset by 90 degrees down?

local goal = camera.CFrame * CFrame.Angles(math.pi/-2,0,0) 

Step 2: Interpolate. There are a lot of options. Here's one:

camera:Interpolate( goal, goal+goal.lookVector*20, 1 )

the focus bit is strange but I'd simply put it kinda closeby. Hope it works!

0
I'm not sure if I'm doing this correctly but it doesn't seem to work. Here's what I've attempted: gmatchOnRoblox 103 — 6y
0
local camera = workspace.Camera camera.CameraType = Enum.CameraType.Scriptable local goal = camera.CFrame * CFrame.Angles(math.pi/-2,0,0) camera:Interpolate( goal, goal+goal.lookVector*20, 1 ) gmatchOnRoblox 103 — 6y
Ad

Answer this question