So I’ve been trying to tween a part and I’m really stuck. I’m pretty new to tweening and I would like some feedback is to what I’m doing wrong here.
TweenService:Create(Reader.KeycardPoses.KeyTypes.Employee.Card, TweenInfo.new(0.15), Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, {Position = Vector3.new(Reader.KeycardPoses.Pos.In.Position)}):Play()
Thanks for your time
1 Like
It should be:
local info = TweenInfo.new(0.15, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
TweenService:Create(Reader.KeycardPoses.KeyTypes.Employee.Card, info, {Position = Vector3.new(Reader.KeycardPoses.Pos.In.Position)}):Play()
Your error:
You need to have the EasingStyle and EasingDirection inside the TweenInfo.new parentheses ()
2 Likes
When I put the code in the whole script stopped working?
Try the edited version, it should work.
1 Like
I hate to ask more but it’s still not working. Do you have any other solutions?
Does it error now? Like it did with ur script
1 Like
Not anymore, but it doesn’t work.
Like does the tween not work or what.
1 Like
SOTR654
(SOTR654)
May 24, 2022, 2:11am
#9
which is the value of Reader.KeycardPoses.Pos.In.Position
?, if it’s a Vector3, change the line to this
TweenService:Create(Reader.KeycardPoses.KeyTypes.Employee.Card, TweenInfo.new(0.15, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut), {Position = Reader.KeycardPoses.Pos.In.Position}):Play()
1 Like
THANK YOU! Works great, I didn’t know It didn’t need a Vector3.
local TweenInfo = TweenInfo.new(0.15 --etc.)
print("Created Info 1/4")
local TweenService = game:GetService("TweenService")
print("Got TweenService 2/4")
local Tween = TweenService:Create(YourPart,TweenInfo,{Position = Vectors.new(YourXYZ)})
print("Tween has been Created. The part will tween from it's current position ("..YourPart.Position..") to ("..Vector3.new(YourXYZ).."). 3/4")
Tween:Play()
Tween.Ended: Connect(function ()
Print("Tween Executed Successfully. 4/4")
Tell if it prints all of them
1 Like
Thanks for your help, its been solved by @SOTR654
1 Like