Say you have PartA a BasePart in workspace and it’s Orientation is being Tweened to Vector3.new(100,0,0)
. In a separate script you want to stop that tween immediately in its tracks.
How would one do this?
Say you have PartA a BasePart in workspace and it’s Orientation is being Tweened to Vector3.new(100,0,0)
. In a separate script you want to stop that tween immediately in its tracks.
How would one do this?
I dont exactly think you can do it, but you might be able to store the Tween in an Array, and check if its Playing or not with the Following:
if Tween.PlaybackState = Enum.PlaybackState.Playing then
-- code
end
To Cancel it, you use Tween:Cancel()
For what he said instead of --code
you would put Tween:Cancel()
That should work, and another thing you could do, is if you’re doing everything in the same script di the same without storing things in an array
Its Tween:Cancel()
, not Tween:Stop()
you can use a module script for that, create the tween and a variable IsTweening
in the module script…
So the first script will tween the part, from the second script, you can require()
and use an if condition to check if it is tweening, and use Tween:Cancel()
Sorry, it’s just that I’m not very used to Tweens and I used Aniantions in the last few days so I got confused, thanks for correcting me tho
If you mean stop right where its at, its Tween:Pause()
.
Yeah I’ve done the methodology of storing it in a table before. I was just hoping it wasn’t the only option since it’d be more convenient for me to not have to do all that. Ah well, thanks lads.
Edit: I realized that one is able to parent the tween object so I will probably be using some kind of workaround with that.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.