Lock vertical facing direction?

How do I lock the vertical facing movement of players? I want them to only change the horizontal angle so they only look left and right, not up and down.

I tried many things, but they never worked out.

you could loop at set facing option thats takes the current looking spot of a player and sets their up/down to the middle
also are you making something doom styled?

no, I am trying to do something moba styled

Try this:

actions
{
Global.Distance = 1;
Start Camera(Event Player, Eye Position(Event Player) + Global.Distance * Direction From Angles(Horizontal Facing Angle Of(
Event Player), 0), Eye Position(Event Player) + (Global.Distance + 1) * Direction From Angles(Horizontal Facing Angle Of(
Event Player), 0), 100);
}

It’s not perfect, it adds delay to your movement and sometimes camera will slightly stutter, sometimes not. Sadly, you can still shoot in vertical angle. I tried setting player’s facing to horizontal on loop, but it stutters too much.
You may wanna adjust the Distance variable (the distance between player’s head and camera) based on which character is currently being played.