Tweens don't play if it is a position tween

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    Tornado formation script.

  2. What is the issue? Include screenshots / videos if possible!
    It doesn’t play the Tween only plays the Transparency tween.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I didn’t try anything yet.
    After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

local tor = script.Parent.Parent["Stage3/Tor"].Funnel
local debris = tor.Parent.GroundDebris.Hurricane
local winds = tor.Wind
if winds.Value > 64 then
	game:GetService("TweenService"):Create(debris,TweenInfo.new(5),{Transparency  = 0}):Play()
	game:GetService("TweenService"):Create(tor.Position,TweenInfo.new(5),{Y = Vector3.new(nil, 63, nil)}):Play()
end

if winds.Value < 64 then
	game:GetService("TweenService"):Create(debris,TweenInfo.new(5),{Transparency  = 1}):Play()
	game:GetService("TweenService"):Create(tor.Position,TweenInfo.new(5),{Y = Vector3.new(nil, 203, nil)}):Play()	
end

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

{Y = Vector3.new(nil, 63, nil)}
You can’t tween or change the ‘Y’ co-ordinate of a Vector3 property. The first argument to TweenService:Create must be an instance.
game:GetService("TweenService"):Create(tor,TweenInfo.new(5),{Position = Vector3.new(tor.Position.X, 63, tor.Position.Z)})
I presume this is what you’re trying to do.

1 Like

One possible issue is that the target position for the position tween is not set correctly. In the code, you are trying to tween the Y component of the “tor.Position” vector, but the syntax is incorrect. Instead of using “Vector3.new(nil, 63, nil)” and “Vector3.new(nil, 203, nil)”, you should use “Vector3.new(tor.Position.X, 63, tor.Position.Z)” and “Vector3.new(tor.Position.X, 203, tor.Position.Z)” to maintain the X and Z components of the position vector.

You cannot change the X, Y, and Z coordinates of a Vector3 directly. You can only change the entire position as a whole. Also, the first parameter must be an Instance, and not a data type.

Try doing this instead:

game:GetService("TweenService"):Create(tor,TweenInfo.new(5),{Position = Vector3.new(tor.Position.X, 63, tor.Position.Y)}):Play()
1 Like

Whole new problem. It moves using BodyVelocity (yes i know they’re deprecated but i like them)
So now the funnel is behind the Debris Cloud and the Storm as a whole

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