- Home /
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).
Answer by Greyeeh · Feb 26, 2015 at 02:57 PM
Solved it by adjusting the transform values in animation manager inside Unity instead of Blender.
Answer by sniper43 · Feb 25, 2015 at 11:11 AM
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.
Thats what I did I guess. Could you take a look at these screenshots http://imgur.com/7lRtvsm Is anything wrong with this? When I look at my Unity sceene my character is in proper swim$$anonymous$$g position (as soon as I exported the old model with added swim$$anonymous$$g animation it changed in scene to it), as soon as I hit play it goes to the idle animation as I scripted. Then when I enter the water it gets messed up :(
Your answer
![](https://koobas.hobune.stream/wayback/20220613184302im_/https://answers.unity.com/themes/thub/images/avi.jpg)