• 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
2
Question by Tom-Atom · Jun 24, 2015 at 07:49 AM · mecanim

Mecanim Idle state resets to original object's position

Hi,

I have small brick which I want to move right by 1 unit to the right. Then I want it to stay in the new position (forever or until some event happens). Move state runs ok and moves brick as expocted. But, unfortunately, then when Idle state is entered, the brick jumps back to object's initial position instead of staying where it was moved by Move state.

I created simple animator controller with two states: Move and Idle. Move state has MoveAnim clip (first screenshot) and Idle state has IdleAnim clip (second screenshot). MoveAnim clip has 2 keyframes (move from position to position). IdleAnim has no key frames as it should do nothing, just stay in Idle state.

I also tried to uncheck Write Defaults on both states, as i thought it will prevent Unity to reset objects position.

I am using Unity 5.1.0f3

Can anyone, please, help me with this?

alt text

alt text

move.jpg (108.5 kB)
idle.jpg (109.5 kB)
Comment
Add comment · Show 7
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 Baste · Jun 24, 2015 at 08:11 AM 0
Share

What's happening makes sense. The "move right" animation has keys that moves the cube to the right, while the "idle" has no keys - this means that the default value for every property will be the one used.

For character models, playing an empty animation makes them go into a T-pose.

Try turning on root motion on your animator component - there's a checkbox. Root motion is supposed to turn animation on the root of the model into motion in the world. I've not got any experience with it, but that's the general idea.

avatar image Tom-Atom · Jun 24, 2015 at 08:24 AM 0
Share

Unfortunately, checking "Apply Root $$anonymous$$otion" did not help. I have only simple 2D object not model. As you wrote, resetting to defaults make sense, but I thought I can override it with unchecking "Write Defaults", which is new in Unity 5.

avatar image Tom-Atom · Jun 26, 2015 at 06:14 AM 0
Share

Ok, Root motion is the key - I got answer from $$anonymous$$ecanim.Dev. Beside just clicking Apply Root $$anonymous$$otion on Animator, it is also neccessary to click button Generate Root $$anonymous$$otion Curves on Animation Clip. This button will appear there only if your animation clip has some change in transform position or rotation.

Now, I added chage of color to my brick during move - from normal to red. I would like it to stay red when IdleAnim is entered. But unfortunately it returns to default normal color. (Wirte Defaults is unchecked). Anyone can help?

avatar image ssedlmayr · Nov 02, 2015 at 09:37 PM 0
Share

I'm having the same issue with a character model and the comment from Jun 26 unfortunately does not work, as Generate Root $$anonymous$$otion Curves is grayed out on all of my clips, despite the fact that they all affect the transform.

avatar image ssedlmayr · Nov 02, 2015 at 09:40 PM 0
Share

In fact, there is no longer a 'Generate Root $$anonymous$$otion Curves' button in 5.2.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by theANMATOR2b · Nov 09, 2015 at 04:54 PM

@Tom Atom - I've not animated color in Unity yet - but if you are attempting to control this in mecanim - shouldn't it be setup with 3 states with normal color = start state, transition animation from normal color to red = second state, then red color is the third state you transition into which keeps the color red.

May also be a bug - 5x, 5.1, 5.2 has been littered with animation bugs.

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

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

25 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to get current state on Mecanim? 4 Answers

Mecanim curve for move speed 0 Answers

Mecanim: BindSkeleton: Cannot find transform 2 Answers

How can I tell what AnimationState mecanim Animator is in from script? 1 Answer

Mecanim For Android! 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