Goal
I’m currently working on a camera cutscene styled system, where the camera of the player is attached to a part, and the part rotates to match the end position and orientation.
Issue
I’m unsure why, but the camera part that the players camera follows isn’t in the correct position whilst rotating to fit the correct orientation. The orientation of both is the same in game, 0,-90,0. Here’s a video showing the issue.
Script
local args = {"Beginning Frame" = game.Workspace.Part1,["Ending Frame"] = game.Workspace.Part2}
local Beginning = game.Workspace["Camera Positions"][args["Beginning Frame"]];local End = game.Workspace["Camera Positions"][args["Ending Frame"]]
local tweenInfo = TweenInfo.new(5);local newPart
if not game.Workspace:FindFirstChild("Camera Tween") then
newPart = Instance.new("Part",workspace);newPart.Transparency = 1;newPart.CanCollide = false;newPart.Anchored = true;newPart.Name = "Camera Tween"
newPart.CFrame = CFrame.new(Beginning.Position)
else
newPart = game.Workspace["Camera Tween"]
end
local tweenPosition = game:GetService("TweenService"):Create(newPart,tweenInfo,{CFrame=CFrame.new(End.Position,End.Orientation)})
tweenPosition:Play()