Wrong rotation while swimming

Hello. I’ve made a swimming animation for my character model. It’s basically a normal model rotated in Y axis (so it looks like it’s laying on the ground) and it moves his hands and legs. It’s supposed to start playing when the player reaches the water level and this part works almost fine.
The problem is that whenever my player enters water he’s still in standing rotation but he’s moving his legs and arms like it is supposed to be in animation.

How do I make him rotate properly? When I’ve used the transform.rotation.z = -90; (if in water) then the player was upside down and after leaving the water the model wasn’t rotating anymore (although the camera was).

Go to the animation and rotate your character there. Try to keep the player Y axis aligned with the world Y axis, there’s fewer issues.

You can rotate the body in the animation, even adjust it’s local position.

You don’t need to code this, you should adjust the animation. You’ve amde it so his feet paddle, now just make it so his feet paddle and he’s in a position you want him to be in when he’s in the water.

Solved it by adjusting the transform values in animation manager inside Unity instead of Blender.