(I hope this is the right catergory)
I’m trying to script a tween that always moves a part an x-number of studs to the left or right, while allowing the rotation and position of the part to change without having to change the script.
Is this possible and if yes how?
TweenService:Create(PART, TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut), {Position = PART.Position + Vector3.new(X,0,0)):Play()
Just change the X
value to the number of studs u want to move.
Yes, but if you rotate the part the tween will glitch as it moves on the wrong axis.
Are u tweening the rotation along with position.
No, but let’s say you make a door that always needs to move 5 studs to the right. When you rotate this door to place it in your map the tween will gltich because to move the door to it’s left you now need to use a different axis.
have you tried manipulating the CFrame instead of vector 3? that should keep the orientation
TweenService:Create(PART, TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut), {CFrame = PART.CFrame * CFrame.new(X,0,0)):Play()
2 Likes