This script provides some script calls that you can use in your conditional branches to check which direction an event is being triggered from. For example you can check whether an event is triggered from the front or from behind, and set up each branch to behave appropriately.
Script: download here
- Open the script editor
- Place this script below Materials and above Main
The following methods are available.
Assuming two characters A and B
from_front? - returns true if B faces towards A from_behind? - returns true if B faces away from A from_left? - returns true if A approaches B from the left from_right? - returns true if A approaches B from the right from_side? - returns true if A approaches B from behind
Note that “left” and “right” depends on the character’s direction
Currently, this assumes A is the player and B is an event, so the “left” and “right” conditions are wrong if an event touches a player.