Help with Parallel Processing

Hey, I recently got (re)into Rpg Maker MV and I am trying to work out what is wrong with my swim function. When I try the following solution, the player is frozen (I am sure some aspect of the parallel process is doing it, or the initial autorun, but I could use some guidance as to how to fix it). My goal is for the game to constantly read the player's y position and change to the swim graphic when he is in water (in this case, in a y-position higher than 8). I have included both pages of the event:

Page 1 - https://i.imgur.com/elk7mjc.png
Page 2 - https://i.imgur.com/lUwrZ1A.png

Many thanks.
You probably should have a Wait in there at the start of the parallel process. You should also have a switch to say whether they're swimming or not, and only change the sprite when they enter or leave the water. The way you have it, the player's graphic is being changed 60 times a second, even when they're standing still.

Something like this:
Code:
Wait 5 frames
Control Variables [0001: Player Y] = Player's Y position
If Variable [0001: Player Y] > 8
  If Switch [0001: Swimming] is OFF
    change to swimming sprite
    Control Switches [0001: Swimming] = ON
  End
Else
  If Switch [0001: Swimming] is ON
    change to non-swimming sprite
    Control Switches [0001: Swimming] = OFF
  End
End

However, there are other potential issues here.

By default, the player can't enter water - even if you set the water autotile passage setting to O. Passage on many of the autotiles is handled internally (for the A1 tile, it's specifically about whether you're in a vehicle or not) and is not based on the passage settings you use for the B-E tiles.

Also, if you have any plugins that use variables, they might default to variable 1. So check and see if any use variables, what they use, and make sure you don't use that variable for any other purpose. Same with switches (more common with switches actually), so if you use my solution above with the switch so the graphic is not constantly changing, make sure you use a switch that's not already being used by any plugins.

The final thing is, changing the actor's sprite via a move route is not permanent - if you change maps, it will go back to the default sprite. I'm not sure what happens if you open a menu then close it. There is a Change Actor Images command you can use if you want the change to be more permanent (not change back until you tell it to).
Thank you, that was extremely helpful. It now works exactly as I wish. I use some plugins which I forgot to mention (all Yanfly) - one of them must be fixing the movement issue you mention. I can enter water no problem - so that's fortunate.

Entering and exiting the menu keeps the current graphic, so that's fine too. I will see how changing maps affects it, but any map I change to will use the same parallel process as this one (and I always fade to black and handle background stuff before tinting to 0, so there won't be a second in which the actor graphic is wrong, hopefully). If I run into trouble I will look into that command you mentioned.

Thanks again for all your help.

Original thread: https://forums.rpgmakerweb.com/threads/help-with-parallel-processing.103819/