MV Change actor sprite temporarily

Hello everyone, let me explain:

I have a character selection system in my game, and I would love to be able to change the character sprites when they are in the water, to simulate that they are swimming, but return it to normal when on land again.
I know that one of the options is to use a conditional drift and make the character sprite change depending on the actor I am using, but there is a problem, and that is that I have a plug in that duplicates the actors, so choosing a specific actor does not work. Is there any method to change the character sprite temporarily, or at least a way to make it simulate swimming, I only plan to use this feature for all the characters, I am not going to make unique sprites for them, because I prefer to focus on other things and I don't want to waste time designing the characters in their swimming position.

1706402196165.png
This should be doable with a couple of lines of code.

In the event where you enter the water, do a Script:
Code:
$gamePlayer.origSprite = $gamePlayer._characterName;
$gamePlayer.origIndex = $gamePlayer._characterIndex;
$gameParty.members()[0].setCharacterImage("swimmer", 0);
$gamePlayer.refresh();
where "swimmer" is the filename of your swimming character sheet.

Then, on the events coming back out of the water,
Code:
$gameParty.members()[0].setCharacterImage($gamePlayer.origSprite, $gamePlayer.origIndex);
delete $gamePlayer.origSprite;
delete $gamePlayer.origIndex;
$gamePlayer.refresh();
This should be doable with a couple of lines of code.

In the event where you enter the water, do a Script:
Code:
$gamePlayer.origSprite = $gamePlayer._characterName;
$gamePlayer.origIndex = $gamePlayer._characterIndex;
$gameParty.members()[0].setCharacterImage("swimmer", 0);
$gamePlayer.refresh();
where "swimmer" is the filename of your swimming character sheet.

Then, on the events coming back out of the water,
Code:
$gameParty.members()[0].setCharacterImage($gamePlayer.origSprite, $gamePlayer.origIndex);
delete $gamePlayer.origSprite;
delete $gamePlayer.origIndex;
$gamePlayer.refresh();
I have already solved it, thank you very much

Original thread: https://forums.rpgmakerweb.com/threads/change-actor-sprite-temporarily.165200/