curcam.CameraType = Enum.CameraType.Scriptable local tween = tweenService:Create( curcam, TweenInfo.new(3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {CFrame = CFrame.new(target.CFrame)}) tween:Play() tween.Completed:Wait() cambinded = true
I have been trying to Tween the Players Camera to a Parts .CFrame for the past hour or so trying different things but.
It only works if {CFrame = CFrame.new(target.CFrame)} is {CFrame = CFrame.new(target.CFrame.Position)}
But I want the Position and Rotation. Not just the position, you see the problem here? and I have no idea why but it just spits me this error: invalid argument #1 to 'new' (Vector3 expected, got CFrame) So I decided to turn here to find answers.
The camera doesn't tween because you have to firstly;
1-Instead of setting the CameraType
one time you should do this to make sure the camera is set to scriptable:
repeat curcam.CameraType = Enum.CameraType.Scriptable wait() until curcam.CameraType == Enum.CameraType.Scriptable --Repeat setting the value until it's scriptable
2-The camera doesn't update because you need to update the camera. RunService
is a service that can run every frame creating another coroutine. Basically, if you place this at the end of your script, the camera will update:
local RunService = game:GetService("RunService") RunService.Stepped:Connect(function() --Run every frame curcam.CFrame = curcam.CFrame --Update the camera end)
For more information about RunService
, you should check: https://developer.roblox.com/en-us/api-reference/class/RunService