local TweenService = game:GetService("TweenService")
local Camera = workspace.CurrentCamera
local TweenCameraFlyUpInfo = TweenInfo.new(4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out)
local TweenCameraFlyUpTable = {CFrame = Camera.CFrame*CFrame.new(0,30,0)}
local CamFlyTween = TweenService:Create(Camera, TweenCameraFlyUpInfo, TweenCameraFlyUpTable)
CamFlyTween:Play()
but im tryna have it just fly straight up, but when it runs it kinda spirals out of control a lil
ive tried it with adding a vector instead of multiplying a cframe but i still get the same issue,
unsure whats going on or how to fix it
Good Day!
I’ve always had issues with tweening cameras directly, but what I do is create a part, and tween the part.
To attach the camera to the part, use RunService to attach the CFrame of the camera to the CFrame of the part.
Your script should look a little something like this
local TweenService = game:GetService("TweenService")
local Camera = workspace.CurrentCamera
local camPart = workspace.--campart name
local TweenCameraFlyUpInfo = TweenInfo.new(4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out)
local TweenCameraFlyUpTable = {CFrame = Camera.CFrame*CFrame.new(0,30,0)}
local CamFlyTween = TweenService:Create(Camera, TweenCameraFlyUpInfo, TweenCameraFlyUpTable)
Camera.CameraType = Enum.CameraType.Scriptable
game:GetService("RunService").RenderStepped:Connect(function() -- Use RunService.Heartbeat if server script
Camera.CFrame = camPart.CFrame
end)
I hope this helps, and if you have an issue I’d be happy to help!
I think it’s because you are multiplying the CFrame instead of adding a Vector3.
Here’s some documentation about CFraming, have a look at the Offsetting a CFrame section.
I think that it doesn’t work on camera bc a roblox script instantly overrides it, which shouldn’t really happen with roblox but, its roblox so what do you expect lol.
I figured out the cause of this problem, turns out
{CFrame = Camera.CFrame*CFrame.new(0,30,0)}
this code right here
broke it because every time it would move the camera, the tween would grab the cameras position at the new movement spot, which just kinda spiraled it out of control