• 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
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 $$anonymous$$s hands and legs. It's supposed to start playing when the player reaches the water level and t$$anonymous$$s part works almost fine. The problem is that whenever my player enters water he's still in standing rotation but he's moving $$anonymous$$s legs and arms like it is supposed to be in animation.

How do I make $$anonymous$$m 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

People who like this

0 Show 0
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
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

People who like this

0 Show 0 · 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

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 t$$anonymous$$s, you should adjust the animation. You've amde it so $$anonymous$$s feet paddle, now just make it so $$anonymous$$s feet paddle and he's in a position you want $$anonymous$$m to be in when he's in the water.

Comment

People who like this

0 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 swimming position (as soon as I exported the old model with added swimming 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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Ellipse Animation by code 2 Answers

Rotating An Object On Its Axis Once 3 Answers

How to Move the rotated Game Object Forward 0 Answers

Why is Unity always adding some strange Transformations? 0 Answers

How do i rotate an object "Once" 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