My character face backwards

Yanfly Action Sequence 2: http://www.yanfly.moe/wiki/Action_Sequence_Pack_2_(YEP)

Whenever my characters attack monsters using the action sequence with some monsters they face the opposite direction of the monster. Here's an example of one of my action sequence

Skill #1 will be used when you select

the Attack command.



<MP Life Steal: 1>



<setup action>







display action



if user.attackMotion() !== 'missile'



camera focus: target

zoom: 120%, 20



camera offset: right, 50





else



camera focus: user

zoom: 150%, 20

wait: 20

camera focus: target

zoom: 120%, 20

camera offset: right, 50



end



immortal: targets, true

</setup action>



<target action>



if user.attackMotion() !== 'missile'

move user: targets, front, 20

else

perform start

end





wait for movement

motion attack: user

wait: 10

attack animation: target

wait for animation



action effect

wait for animation

wait for movement

wait: 5



</target action>
I am somewhat familiar with why this happens, and have an idea for how to fix it without modifying the plugin
The most notable time when this will happen is when your action sequence repeats itself, particularly if it's a skill that repeats, or if you have attack # set greater than 1 (or use my dual wielding plugin). The reason for this is that the move action is happening in the <target action> section, and it repeated when a skill is repeated. When the first move is done, the actor moves to the correct location, and then hits the enemy, causing it to flinch, moving back on screen a few pixels. When the action is repeated, the actor needs to reposition slightly, as it is no longer at the target, front location, but only has to move a few pixels to the left. Because this new X position is still inside the sprite of the actor, a function in the action sequence plugin assumes that the new X value is to the right of the current position, and mirrors the sprite for it's slight left movement.

To correct this, you can find where it makes this mirroring decision and change it so that it checks only the new x position and the old one, not the farthest bounds of the actor sprite on the x axis. Most likely, this will not be a quick change, and I haven't looked into it myself yet. The best alternative is to move your actor to the enemy in the <setup action> part of the sequence instead, so that it doesn't try to move a few pixels left after the first hit. Alternatively, you could turn the flinching feature off entirely, in battle engine core, I think.
I am somewhat familiar with why this happens, and have an idea for how to fix it without modifying the plugin
The most notable time when this will happen is when your action sequence repeats itself, particularly if it's a skill that repeats, or if you have attack # set greater than 1 (or use my dual wielding plugin). The reason for this is that the move action is happening in the <target action> section, and it repeated when a skill is repeated. When the first move is done, the actor moves to the correct location, and then hits the enemy, causing it to flinch, moving back on screen a few pixels. When the action is repeated, the actor needs to reposition slightly, as it is no longer at the target, front location, but only has to move a few pixels to the left. Because this new X position is still inside the sprite of the actor, a function in the action sequence plugin assumes that the new X value is to the right of the current position, and mirrors the sprite for it's slight left movement.

To correct this, you can find where it makes this mirroring decision and change it so that it checks only the new x position and the old one, not the farthest bounds of the actor sprite on the x axis. Most likely, this will not be a quick change, and I haven't looked into it myself yet. The best alternative is to move your actor to the enemy in the <setup action> part of the sequence instead, so that it doesn't try to move a few pixels left after the first hit. Alternatively, you could turn the flinching feature off entirely, in battle engine core, I think.

I actually moved some of the larger enemies farther away from actor and the characters don't face the opposite direction anymore. Thanks for trying help me out.

Original thread: https://forums.rpgmakerweb.com/threads/my-character-face-backwards.114092/