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

Rolling a camera and haveing it follow?

Asked by 7 years ago
Edited 7 years ago

Hi, am trying to figure out how I can roll a camera and have it follow the player/part. I've found that I can roll the camera using

1workspace.CurrentCamera:SetRoll(math.rad(20))

in a local script inside "StarterPlayerScripts", and changing the CameraType to "Scriptable". Unfortunately when I set it to "Scriptable" the camera dos not follow. When I set it to "Follow" the camera will follow the Player but will not roll. Isn't there some way to make the camera roll and follow? I thought I saw some check box for VR stuff that might allow the cameraTypes to be able to roll?

Update: Here is some code I just got some where else and added Interpolation. Works pretty well actually but still not perfect. Have any suggestions to make it smoother?

01repeat wait() until game.Players.LocalPlayer
02 
03local target = game.Players.LocalPlayer.Character.Head
04local camera = game.Workspace.CurrentCamera
05camera.CameraType = Enum.CameraType.Scriptable
06print(camera.CameraType) -- Debug to make sure that I don't get "Camera isn't set to scriptable" errors
07 
08 
09function Update() -- Track player
10    while true do
11 
12        workspace.CurrentCamera:Interpolate(CFrame.new(workspace.CurrentCamera.CFrame.X,workspace.CurrentCamera.CFrame.Y,workspace.CurrentCamera.CFrame.Z),
13                                CFrame.new(target.Position),
14                                --* CFrame.new(0, 5, 10)
15                                --* CFrame.Angles(-0.5, 0, 0),0,0.1),
View all 60 lines...
0
http://wiki.roblox.com/index.php?title=API:Class/Camera/Interpolate You could interpolate the camera behind the player every second or so with a loop, meanwhile changing the roll as you please. saenae 318 — 7y
0
I actully just did that right before you commented this XD Worthy0ne 68 — 7y
0
My work is above if you have any suggestions ;) Worthy0ne 68 — 7y

Answer this question