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

Why wont my tweening airport card gate work?

Asked by 5 years ago

Here's the code. The door just bounces up and down they stops mid air! So weird. (the gui works fine) https://www.screencast.com/t/7xcx8WCil < explorer screenshot

local tweenService = game:GetService("TweenService")

local door1 = script.Parent.Parent.Door1
local door2 = script.Parent.Parent.Door2
local walkforwardgui = script.Parent.Parent.HitDetector.WalkforwardGUI

local cyl1 = script.Parent.Parent.Cylinder1
local cyl2 = script.Parent.Parent.Cylinder2

script.Parent.Touched:Connect(function(hit)
    if hit.Parent.Name == "Eco" or hit.Parent.Name == "FC" or hit.Parent.Name == "Premium" then
        local player = game.Players:GetPlayerFromCharacter(hit.Parent.Parent)
        local walkforwardguiclone = walkforwardgui:Clone()
        walkforwardgui.Parent = player.PlayerGui
        walkforwardgui.Main.Visible = true
        walkforwardgui.Main.Text.Text = "Walk forward, "..player.Name

        local properties =
        {
            CFrame = CFrame.new(cyl1.Position),
            Rotation = Vector3.new(0, 90, 0)
        }

        local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Bounce, Enum.EasingDirection.Out,
            1, true, 0
        )

        local tween = tweenService:Create(door1, tweenInfo, properties)
        tween:Play()

        wait(3)
        walkforwardgui.Main.Visible = false
    end
0
yeah boiiiii!!! Zenith_Lord 93 — 5y
0
it's a great question!!!! Zenith_Lord 93 — 5y
0
whoaaa i wonder why!!!! Zenith_Lord 93 — 5y
0
I'm pretty sure Rotation is deprecated, and you shouldn't use that to rotate parts. CFrames hold both position and rotation information, so rotate with CFrame instead. User#24403 69 — 5y
View all comments (2 more)
0
are the parts anchored? Questofmagicfarts 55 — 4y
0
if not then anchor them and i think they will work! Questofmagicfarts 55 — 4y

Answer this question