✓ Accepted answer
I just made that yesterday. Use TweenService. I know there are many methods, rendrestepped, loops, interpolate, etc.. However TweenService works best, since it is coded in underlying engine code, rather than Lua. Here is an example (LocalScript in StarterPlayerScripts):
local TweenService = game:GetService("TweenService")
local player = script.Parent.Parent
character = player.CharacterAdded:wait()
humanoid = character:WaitForChild("Humanoid")
local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable
camera.CameraSubject = workspace
local target = {CFrame = CFrame.new(Vector3.new(200,100,50), Vector3.new(0,100,0))}
local TweeningInformation = TweenInfo.new(
3
Enum.EasingStyle.Linear,
Enum.EasingDirection.InOut
)
local moveCamera = TweenService:Create(camera,TweeningInformation,target)
moveCamera:Play()
wait(3)
camera.CameraType = Enum.CameraType.Custom
camera.CameraSubject = humanoid
If you are interested how it works, check the intro to my game:
https://www.roblox.com/games/2418401851/Crazy-Stairs-ALPHA
1 comment
yep. it works. Thanks for the help :)