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

Why does the plane reset back to its origin? (CFrame)

Asked by 3 years ago

Here an example: https://gyazo.com/944f3fd29f7c24dd033fa1f396b2e65d

Read below this script(this is full script)


local Crashs = math.random(1,2) if Crashs == 1 then local newCFrame = CFrame.Angles(math.rad(-10),0,0) local newCFrame2 = CFrame.Angles(math.rad(10),0,0) local TweenService = game:GetService("TweenService") local Tweener1 = script.Parent local Info = TweenInfo.new(2.2, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0) local InfoAngle = TweenInfo.new(2.3, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 0 ) local Goals = { Position = Vector3.new(-16.84, -81.92, -336.77);} local PartPositionA = TweenService:Create(Tweener1, Info, Goals) local SecondGoals = { Position = Vector3.new(-16.84, -19.06, -3.33);} local PartPositionB = TweenService:Create(Tweener1, Info, SecondGoals) local ThirdGoals = { Position = Vector3.new(-18.34, -99.19, 538.82);} local PartPositionC = TweenService:Create(Tweener1, Info, ThirdGoals) local ForthGoals = {CFrame = Tweener1.CFrame * newCFrame } local PartAngleA = TweenService:Create(Tweener1,InfoAngle,ForthGoals) local FifthGoals = {CFrame = Tweener1.CFrame * newCFrame2} local PartAngleB = TweenService:Create(Tweener1,InfoAngle,FifthGoals) wait(2.4) PartPositionA:play() PartAngleA:play() --Brings back the plane FIX! wait(1.2) PartPositionB:play() wait(2.2) PartPositionC:play() wait(1) script.Parent.CanCollide = false end if Crashs == 2 then print ("it was 2!") end

you really want to look at the

local ForthGoals = {CFrame = Tweener1.CFrame * newCFrame }
local PartAngleA = TweenService:Create(Tweener1,InfoAngle,ForthGoals)
local FifthGoals = {CFrame = Tweener1.CFrame * newCFrame2}
local PartAngleB = TweenService:Create(Tweener1,InfoAngle,FifthGoals)

and


wait(2.4) PartPositionA:play() PartAngleA:play() --Brings back the plane FIX! wait(1.2) PartPositionB:play() wait(2.2) PartPositionC:play() wait(1)

any help is appreciated

https://gyazo.com/944f3fd29f7c24dd033fa1f396b2e65d

Answer this question