player and event are facing the same direction condicional branch

Hello,i want to make a condicional branch that activate if the event and the player are facing the same direction
Hi!
In Control Variables:

Store the direction of the player in a variable.
Store the direction of the event in another variable.

In the conditional branch:

Compare if the two variables are equal.
Hi @DarielZer0 . You can try this.
Put inside the conditional branch as a script call (Page 4):
Spoiler: Code
JavaScript:
// replace eventId with ID# of the event     
// Player and Event faces the same direction. For example both facing RIGHT.
$gameMap.event(eventId)._direction === $gamePlayer._direction;
// Player and Event faces each other. For example player facing UP while event facing DOWN.
$gameMap.event(eventId)._direction === 10 - $gamePlayer._direction;

Original thread: https://forums.rpgmakerweb.com/threads/player-and-event-are-facing-the-same-direction-condicional-branch.143431/