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

Can someone help me with Camera Rotation Tilt?

Asked by 8 years ago

So I have a script that rotates around a part so that you can see the different sides of the part while it's rotating. Except the camera rotates around it but it is pointed straight forwards. I was wondering if there was a way to change it so the camera rotates around the object but the camera is pointed down a bit towards the object. Here is my script.

local target = workspace.Part86
local cam = workspace.CurrentCamera

cam.CameraSubject = target
cam.CameraType = "Scriptable"

local angle = 0
local speed = 50

while true do
    angle=angle+(game:GetService("RunService").RenderStepped:wait()*speed)
    cam.CFrame = target.CFrame * CFrame.Angles(300,math.rad(angle),0) * CFrame.new(0,0,50)
end

1 answer

Log in to vote
0
Answered by
Dominical 215 Moderation Voter
8 years ago

Try using the Camera's focus property rather than it's CFrame. The focus property tells the camera what point it should look at. Maybe try manipulating your script using this? http://wiki.roblox.com/index.php?title=API:Class/Camera/Focus

Hope this helps! Appreciate ya! ;)

Ad

Answer this question