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

I'm trying to make a Tween, but for some reason it doesn't play , can anyone help?

Asked by 4 years ago
-- LocalScript

wait(2)
local door = game.Workspace.Door.Main
local UIS = game:GetService("UserInputService")
local tweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(2,Enum.EasingStyle.Sine,Enum.EasingDirection.In,0,true,0.5)
local secondDoor = door.Parent.SecondMain
local secondPosition = {}
secondPosition.CFrame = door.CFrame

local doorAnimation = tweenService:Create(door,tweenInfo,secondPosition)

print("Everything loaded")

UIS.InputBegan:Connect(function(input)
    if input.KeyCode == Enum.KeyCode.E then
        print("You pressed E")
        doorAnimation:Play()    
    end
end)
    -- It printed "You Pressed E"
0
Tysm I didn't notice it lol NicoXerocious 29 — 4y

1 answer

Log in to vote
1
Answered by
Fifkee 2017 Community Moderator Moderation Voter
4 years ago
Edited 4 years ago

You set "secondPosition.CFrame" to the door's initial CFrame, meaning that it doesn't move at all. The tween does infact play, but not how you want it. Did you possibly mean secondDoor.CFrame, perhaps?

Ad

Answer this question