[Solved] Collision moves object using timer problem

hello I have a vine object that moves up stops then moves down stops and repeats on a timer whenever the player is in collision with vinetrigger. the problem is sometimes when the player is on collision then quickly moves off the vine stops moving up until the player is on collision. how can I prevent this?


If I read it correctly, if the player hits the vine trigger, you want the vine to move up, pause and then move back down?

If this is right, have you thought about using tweens instead of forces?

yes and the movements repeat unless player is not on collision. would using tweens to move the vine prevent the problem of stopping sometimes when player is not on collision?

It should, as long as you only start a tween if there isn’t already one playing.

ok thanks I changed movement to tween and added a condition tween is not playing but the problem is still happening. instead of stopping sometimes like before the vine will move up a short distance then stop and abruptly go down :open_mouth: how do I get the vine to complete the movement all the way up and down?


You shouldn’t mix timers & variables to control tweens that way. It’s only asking for trouble.

Use the tween’s timer to control the movement, so you have something like this :

1 Like

ah I thought the timer had to do with the problem :no_mouth: thank you works perfect the logic is simple to understand and I’m more confident using tweens.

1 Like