Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

-- 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"

1 comment

0

Tysm I didn't notice it lol

1 answer

✓ Accepted answer

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?

This discussion is preserved as it was. New answers, comments, and votes are closed.