Sprite blink on script call for character index

When changing the gamePlayer characterIndex or spritesheet, it does a 1 or 2 frame blink.

$gamePlayer._characterIndex = 1;

Anyone know how to avoid this??

Basically, what I'm doing is I have an event with Parallel Trigger which is listening to the 'ok' input trigger, in order to change the players spritesheet for a couple frames. I'm doing this in order to have the player punch on the overworld basically. My problem is that when I'm changing the spriteseet, or the index of the image I'm using for the player, it does a short blink when loading the new file/index.
When changing the gamePlayer characterIndex or spritesheet, it does a 1 or 2 frame blink.

$gamePlayer._characterIndex = 1;

Anyone know how to avoid this??

Basically, what I'm doing is I have an event with Parallel Trigger which is listening to the 'ok' input trigger, in order to change the players spritesheet for a couple frames. I'm doing this in order to have the player punch on the overworld basically. My problem is that when I'm changing the spriteseet, or the index of the image I'm using for the player, it does a short blink when loading the new file/index.
Greetings,

This is always going to happen when changing a spritesheet for an event (or the player) on-screen. Just how the engine handles swapping the spritesheet.

What you can do is create a "duplicate" of your character off-screen with 0 transparency. When it's time for the swap, shift the fully transparent duplicate underneath the player, then simultaneously make the duplicate opaque and your player transparent. This will result in no blink noticed by the human eye, it will simply look like your character did the punching animation.

Hope this helps and happy game making,
-Niniann
There have been several threads about this:


For changing spritesheets, you can try a script call to preload the file; but if you're seeing it even changing between indices on the same sheet, @Niniann's method may be best.

Original thread: https://forums.rpgmakerweb.com/threads/sprite-blink-on-script-call-for-character-index.172680/