I would like to create an arrow that tweens between -90 and 90 Rotation. However, I would like to make it so that when a player clicks a button it will flip the direction of the current tween and make it tween in the opposite direction (towards the opposite value). I would like the tween in the opposite direction to start from the location it was at when the player clicked the button.
For example, if the rotation is currently at 70 tweening towards 90, I would like the button to make it so that when it is clicked, the tween towards -90 will start from 70 rotation.
My use case here is some type of “keep the arrow in the green area” minigame where the arrow moves from side to side and you have to switch the direction to keep it in the middle.
I am not sure if using TweenService:Create()
will suffice here (it hasn’t so far) or if I should do some type of RenderStepped loop to achieve this behavior. Any help or advice for creating a system like this is greatly appreciated.