Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to combine orientation and cframe?

Asked by 6 years ago
local TweenService = game:GetService("TweenService")
local tweeningInformation = TweenInfo.new( 4, Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0)
local C1 = workspace:WaitForChild("Cameras")
local cam = C1:WaitForChild("StartCamera")
local red = true
local Pos1 = {}
Pos1.CFrame = CFrame.new(-63.141, 5.5, -107.39)
Pos1.Orientation = Vector3.new(0, 129.72, 0)      

local Pos2 = {}
Pos2.CFrame = CFrame.new(-28.026, 5.5, -107.39)
Pos2.Orientation = Vector3.new(10, -49.61, 0)

local tween1 = TweenService:Create(cam,tweeningInformation,Pos1)
local tween2 = TweenService:Create(cam,tweeningInformation,Pos2)

while wait() do
    if red == true then
        red = false
        tween1:Play()
        wait(4)
        tween2:Play()
        wait(4)
        red = true
    end
end

When I remove the position, orientation works, when I don't it doesn't, I tried combining CFrame and Orientation but it didn't work out :/

0
A CFrame contains rotation as well so the two types conflict. I would use CFrame.new(args) * CFrame.Angles(rotation in radians) User#5423 17 — 6y

Answer this question