Why does it move like this?

This is a TweenService issue. It’s supposed to move on the Z Axis only, but it’s moving on the X Axis as well? What’s up with that?

  1. What do you want to achieve? A fix to the code below.

  2. What is the issue? Parts only need to move on the Z Axis, but they move on both the Z Axis and the X Axis.

  3. What solutions have you tried so far? Changing the EasingDirection and the EasingStyle.

These moving parts are supposed to move on the Z Axis, not the Z Axis and the X Axis. The code should hopefully do all of the explaining. (This code runs for whatever part the script is parented to, which all has the same Orientation.)

local Speed = script.Speed -- (Which is 30 for the amount I'm looking for.)
local TweenService = game:GetService("TweenService")

Tentacle = script.Parent

Tweens = TweenInfo.new(
	
	Speed.Value, -- (Speed/Time) However ya wanna look at it.
	Enum.EasingStyle.Linear, -- The part moving animation. (EASING STYLE)
	Enum.EasingDirection.Out, -- What direction it moves in. (EASING DIRECTION)
	0, -- How many times it loops. (REPEAT COUNT)
	false, -- (REVERSES)
	0 -- Delays before repeating itself... but if you have repeat count set to 0.. then..
)
                               
local Animator = TweenService:Create(Tentacle, Tweens, {Position = Tentacle.Position+Vector3.new(0, 0, 1250)})  -- (Umm. X Axis is CLEARLY set to 0. Why is it still moving towards that direction?)
Animator:Play()
task.wait(18)

script.Parent.Parent:Destroy()

This is the TweenService code. If you can help me, by telling me what I need to do, I’ll be grateful, and consider your comment the SOLUTION.

probably there’s another script moving the X axis

Unfortunately, that is not the issue.

wait are you supposed to add the vector3 or no, that looks odd, there should be a period before the vector3 id reckon

Your code that defines where it goes and plays are a little different from the dev hub. Try something like this that is not in the tween play function.

local goal = {} goal.Position = Vector3.new(10, 10, 0)

Thanks. That worked. Your reward is getting your Solution box checked. :rofl:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.