Help with changing player patterns

Hello all, I am trying to use scripts to animate my player using all 12 walking frames, but something seems to have gone wrong. When I do this for other events, it works fine, but when I try to use $gamePlayer in the change pattern script, nothing happens to my player. I was thinking that maybe $gamePlayer might not be the correct thing to use, but I am not sure. My event's contents are as follows:

Code:
◆Set Movement Route:Player (Wait)
:                  :◇Script:$gamePlayer._originalPattern = 0; $gamePlayer.resetPattern(); $gamePlayer.setDirection(2);
:                  :◇Wait:30 frames
:                  :◇Turn Left
:                  :◇Wait:30 frames
:                  :◇Turn Right
:                  :◇Wait:30 frames
:                  :◇Turn Up
:                  :◇Wait:30 frames
:                  :◇Script:$gamePlayer._originalPattern = 1; $gamePlayer.resetPattern(); $gamePlayer.setDirection(2);
:                  :◇Wait:30 frames
:                  :◇Turn Left
:                  :◇Wait:30 frames
:                  :◇Turn Right
:                  :◇Wait:30 frames
:                  :◇Turn Up
:                  :◇Wait:30 frames
:                  :◇Script:$gamePlayer._originalPattern = 2; $gamePlayer.resetPattern(); $gamePlayer.setDirection(2);
:                  :◇Wait:30 frames
:                  :◇Turn Left
:                  :◇Wait:30 frames
:                  :◇Turn Right
:                  :◇Wait:30 frames
:                  :◇Turn Up
:                  :◇Wait:30 frames
Little confused here. What is the "change pattern" script? Could you show a screenshot of your entire event?
By default only events reference _originalPattern. Other characters just reset to pattern 1, i.e. "middle".

This little plugin may help (untested):
Spoiler: plugin code
JavaScript:
/*:
 * @target MZ
 * @plugindesc Permit use of _originalPattern for non-event characters.
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/threads/159233/
 * @help Free to use and/or modify for any project, no credit required.
 */
void (alias => {
  Game_CharacterBase.prototype.isOriginalPattern = function() {
    if ("_originalPattern" in this)
      return this.pattern() === this._originalPattern;
    return alias.apply(this, arguments);
  };
})(Game_CharacterBase.prototype.isOriginalPattern);

void (alias => {
  Game_CharacterBase.prototype.resetPattern = function() {
    alias.apply(this, arguments);  // better odds of cross-compatibility
    if ("_originalPattern" in this)
      this.setPattern(this._originalPattern);
  };
})(Game_CharacterBase.prototype.resetPattern);
I.e. check and reset to _originalPattern if that is defined.

Also, since your route is for the player, you could just replace $gamePlayer with this: slightly shorter to write, same result. 👋

@werzque - it's the script command they're using in the move route, as here:
Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/help-with-changing-player-patterns.159233/