Camera Circle Interpolation?
So I made this script and it does work to a certain degree. The goal is to spin around an object and rise straight up still facing the nub of the circle. It is really blocky thought and not smooth. When the camera interpolates, it does not keep it's focus on the nub but rather the focus moves right with the camera as it interpolates.
Essentially it's really simple. It creates the position around the origin. Rises straight up. Finds the angle around the circle. Pushes the position to the circumference of the circle. Finds the nub of the circle at that height. Interpolate.
--module script
01 | function bod.SpinRise(cam, rise, origin, radius, wai) |
02 | local spin = 1440 /rise |
05 | local cf = (origin * CFrame.new( 0 ,i, 0 )) |
06 | * CFrame.Angles( 0 ,math.rad(spin*i), 0 ) |
07 | * CFrame.new( 0 , 0 ,-radius) |
08 | local look = origin * CFrame.new( 0 ,i, 0 ) |
09 | cam:Interpolate(cf,look,ti) |
--Local script
1 | local camlib = require(game.Workspace.CameraLibrary) |
2 | local cam = game.Workspace.CurrentCamera |
3 | local orig = CFrame.new( 0 , 0 , 0 ) |
4 | cam.CameraType = "Scriptable" |
6 | camlib.SpinRise(cam, 100 ,orig, 50 , 60 ) |
It does work but it's a very choppy. What can I do to make it smooth?