• 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 SvenK · Mar 18, 2016 at 12:32 PM · animationrigidbody2dkinematic2d rotation

Animating rotation with root motion applied on a 2D sprite which has a kinematic rigidbody2D doesn't work

Hi, I'm facing a little problem and don't know whether it's a bug or I'm just missing something.

I created an empty scene and put a sprite named "New Sprite" into it. The sprite has an Animator component attached which plays a simple 45° rotation animation in a loop. On the sprite animation asset I hit the "Generate Root Motion Curves" button so root motion is driven by curves. On the Animator the "Apply Root Motion" checkbox is selected. The sprite also has a Rigidbody 2D component and a Box Collider 2D attached to it. On the collider the checkbox for "Is Trigger" is checked, same with "Is Kinematic" on the rigidbody. When the scene is started the sprite doesn't rotate, maybe it rotates a little bit, but then it gets stucked.

If I uncheck "Is Kinematic" or "Apply Root Motion" everything works, except that it will be affected by physics and drops off the screen which I don't want or the spin rotation jumps back to the beginning which I also don't want. So how can I get it work?

Here is a screenshot of the setup to show what I mean.

alt text

The cube is only for demonstration purposes, but the interesting thing is with the 3D model everything works. The cube has also a simple rotation animation attached and as root motion applied. The rigidbody is kinematic and the collider is set as a trigger. There the rotation works as expected, but 2D doesn't.

I read somewhere that the Interpolation for the rotation has to be set to "Euler Angles (Quaternion Approximation)" or "Quaternion", but that didn't help either.

alt text

So I don't know what to do to get this work. My real life scenario is a 2D game with many static sprites in the scene. They have a collider, but no rigidbody, because there is no physics in the game and the collider are for touch detecting purposes. However there are some sprites which should move by an animation. So they have a kinematic rigidbody and the collider is set as a trigger, because I want to get informed via script when the moving sprite is overlapping specific static sprites. That all works fine, except when the moving sprite shouldn't only move, but also rotate.

I just updated to Unity 5.3.4f1 on my Mac 10.11, but the problem remains. So any advice will be highly appreciated.

bildschirmfoto-2016-03-16-um-092935.png (47.1 kB)
bildschirmfoto-2016-03-16-um-090505.png (245.9 kB)
Comment

People who like this

0 Show 2
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 SvenK · Mar 29, 2016 at 09:43 AM 0
Share

No one can confirm that this is a bug or tell me what I'm doing wrong?

avatar image SvenK · Apr 05, 2016 at 10:31 AM 0
Share

Just created a bug report for the Issue Tracker.

0 Replies

· Add your reply
  • Sort: 

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Why can't the weight of IK constraint be keyframed with Animation Rigging package? 0 Answers

OnAnimatorIK and LateUpdate execution order 0 Answers

Avoid moving platform pushing falling object 1 Answer

[Video] 2D hinge joints not working. 1 Answer

Problem with a RigidBody and IsKinematic... I think 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