Check follower direction

Hello!

As you know, you can store game data - X, Y, direction etc. for player or events. I need something similar for a follower.
I found you can use
Code:
$gamePlayer._followers.follower(0).x
$gamePlayer._followers.follower(0).y
to assign the X and Y positions. I was wondering if there was a similar script call which can check the direction a follower is facing (and store it inside a variable to use later).

Thank you in advance!
There's some good documentation here about all the built-in variables and functions in the RMMV code.

Here's how you can use that documentation to find what you need:
  1. Game_Player.followers() returns an instance of Game_Followers
  2. Game_Followers.follower(index) returns an instance of Game_Follower at index
  3. Game_Follower.direction() returns an integer that represents the direction
Putting it all together, to get the direction of a follower:
Code:
$gamePlayer.followers().follower(index).direction()
You can assign this to a variable using the Control Variables Event Command, with the script option.
Thank you for the solution and also thanks for linking to the documentation! That will definitely be helpful in the future.
Thread closed IgnoreMe

Original thread: https://forums.rpgmakerweb.com/threads/check-follower-direction.104072/