How do I make an enemy face a player but only by turning left and right.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By 00Henry

I am trying to make a game where enemies spawn around the map and chase the player. The player uses a weapon to kill them.

I found a way to make the enemy face the player, but as it gets closer it begins to turn and face the sky. I want them to just turn toward the player going left and right but not up and down.
I did use the look command.

I am using a Kinetic Body, Collision shape, and mesh instance

00Henry | 2023-03-16 14:04

:bust_in_silhouette: Reply From: CassanovaWong

depends on what nodes you’re using.

I use polygons a lot, so I usually just change the x scale.

if it’s a sprite you can use flip_h.