Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Greyeeh · Feb 25, 2015 at 10:57 AM · animationrotationjavascripttransform

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).

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

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.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Greyeeh · Feb 25, 2015 at 11:16 AM 0
Share

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

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Top-down character running animation based on facing direction 0 Answers

Door opening in the wrong direction..... 0 Answers

Animating in Unity Rotation snaps to last rotation key 0 Answers

How do I add rotation according to mouse movement to a character even though animation is being played? 0 Answers

Adding child repositions parent tranform 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges