(Solved) Dog changing angle when following the ball

Hi there! I’m making a section in my video game without any actual plot purpose: just a fun little side area dog park.

My character and the soccer ball both have physics, and the dog has a constant movement towards the ball installed in events. This all works well and good.

But I’m unsure how to make the dog flip to the right when he chases the ball to the right! Right now he’s stuck on that particular left-facing frame.

Thank you in advance!

2 Likes

You would have to use the x position of the ball to flip the dog horizontally
Condition
X position of ball is > dog.X()

Action
Flip dog horizontally = yes

Condition
X position of ball is < dog.X()

Action
Flip dog horizontally = no

Note = the flipping depends on the original direction of the dog when added into the editor.

You might have to reposition the the point of the ball.
By default it’s placed at the top left, I would advise you position that in the middle.

1 Like

Thank you so much!!! This will help a ton!

Glad I could help :blush: