Limit Vertical facing angle/direction

So the game i’ve been working on, a few Rules had to change cuz the ‘Firing animation exploit glitch’ in OW2 no longer works. So i gotta come up w/ new stuff…

So playing around w/ Lucio’s wall ride ability. I wanna give Lucio a ‘jump’ boost when he jumps off walls, so Apply Impulse, Facing Direction Of right after you jump off a wall works…But, i need to limit the vertical aspect of the Facing Direction so you can’t jump Stright up in the air (funny as it may be, but not what i want)

In the Workshop, Vertical Facing Angle of a player is 0° when parallel to the ground. Positive {1° to 89°) when looking DOWN (weird, but ok) and Negative {-1° to -89°) when looking UP. So how would I got about limiting their UP facing angle?
Not in the way of restricting their character from being able to look Up, but rather, the Impulse angle is capped at 20° (…or in this case, -20°)

So:
Apply Impulse: Event Player
IF: Vertical Facing Angle Of(Event Player) > -20
Then: Facing Direction Of(Event Player)
Else: wtf I put here? Subtract Facing Direction from…something? or?

There are other ways i could go about it, but i can’t imagine there isn’t a simple way to limit or alter the Vertical aspect of the Vector.
Thanks.

1 Like

Maybe Vector(0,0,0) would be the hard limit note facing direction is considered as a normalized vector where its compound values can range from -1 to 1.

actions
{
Apply Impulse(Event Player, Direction From Angles(Horizontal Facing Angle Of(Event Player), Max(Vertical Facing Angle Of(Event Player), -20)), 10, To World, Cancel Contrary Motion);
}
1 Like

Damn thanks. I knew there had to be a simple way of going about it. TY my guardian angel!