Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 mtear · Jun 15, 2014 at 05:11 PM · animationrigidbodygravitycurveanimationcurve

Tranform Animation Curve ruins Gravity

Hey guys,

I'm very new to Unity. Been doing it about two days now.

I'm about done making a Flappy Bird clone. The only thing left for me to do was the intro portion where the bird oscillates up and down. So I made an Animation for it and added a curve for Transform->Position. I succeeded in making the bird oscillate up and down.

But then afterward the Gravity on the Bird wouldn't work any more! The Bird has a Rigidbody 2D on it. I set the GravityScale before the animation to 0 and then afterward to 1. Even omitting the GravityScale being set to 0, still no Gravity. I then made it so the Animation with the transform curve never played, STILL no Gravity. I checked and unchecked "Apply Root Motion" to no success. Only after I either remove the animation or remove the position curve entirely does Gravity start to work again. Why would this be? ESPECIALLY when the animation doesn't even play?

Interestingly, while the Gravity was failing, the Bird would still rotate back and forth from flaps and its downward velocity (from a Lerp), meaning it was receiving "velocity" changes despite not moving.

And then, when I tried to change the Curve instead to a rotation curve, it would rotate in the animation, gravity would work, but then I couldn't set the rotation after the animation finished from code! It always stayed at 0.

  1. Why did my gravity fail to work?

  2. What is the best practice to handle animations on objects with rigidbodies?

  3. What's the easiest way to make my oscillation animation without affecting the physics?

Thanks!

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by jouyang3 · Sep 19, 2014 at 01:00 AM

I have encountered the same issue. I have read this article and applied its fixes but it doesn't really work out at the end. Apparently, it states that there's an issue between animation update rate and physics update rate.

Regardless, here's the URL, I hope you might find it useful:

http://grovecodeblog.wordpress.com/2013/10/30/combining-physics-and-animation-in-unity/

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.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Create a linear animation curve with javascript 1 Answer

My Mecanim-Generic is screwing with the gravity 2 Answers

Animation Events and Mecanim 2 Answers

Evaluating Animation Curves in Full 0 Answers

Gravity does not work with animation. 2 Answers


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