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
1
Question by aormsby · Dec 01, 2013 at 08:15 AM · physicsanimatoranimate

How can I use Animate Physics in a project?

I've been trying to figure out what the Animate Physics check box does on the Animator controller, and I've had absolutely no luck. I do know that it uses kinematic rigidbodies to affect other objects, but I don't understand how.

As an example, I was under the impression that I could use Animate Physics to carry a player on a moving platform, but it doesn't seem to work properly. The player just keeps falling off.

Could someone enlighten me as to how the Animate Physics setting truly works and what it can be used for?

Comment
Add comment · 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 springwater · Mar 31, 2016 at 12:42 PM 0
Share

I had an arm with a sword parented to the hand bone in blender.. i imported it and put a box collider on the sword.. it worked for one kill.. then quit interacting with my monsters colliders.. i couldn't figure it out after a lot of hassle.. I tried the animate physics.. it didn't seem to solve my problem.. so i created a spawn point and shot invisible projectiles ins$$anonymous$$d while my sword swing animation played.. its ok now.. but I wish i could have gotten that box collider to work..

avatar image meat5000 ♦ springwater · Mar 31, 2016 at 12:48 PM 0
Share

@springwater

Your problem, I imagine, is related to OnCollisionEnter callback and the fact that there is always something in contact with the collider, namely the player's collider.

You can test this theory by adding

 function OnCollisionExit()
 {
      Debug.Log("EXITED");
 }

and seeing if the debug message ever fires.

2 Replies

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

Answer by Kavorka · Feb 12, 2014 at 08:08 PM

Hello Animate physics only changes when the animator updates. If not set, animator updates after Update and before LateUpdate. If set, animator updates with FixedUpdate. It is not a magic button that turns a character into this.

Comment
Add comment · Show 4 · 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 Raunchard · Nov 07, 2015 at 02:56 PM 0
Share

how did you create these effects which seem to combine rootmotion and forces somehow?

avatar image jonavuka · Oct 18, 2017 at 07:44 PM 0
Share

What do you mean the animator updates after Update and before LateUpdate, updates what? I track the transform of a bone where it is animated and I can see in fixedUpdate, Update and LateUpdate it the transform position changes. Btw the animator update mode is on "Normal" but even if I set it to Animate Physics it still behaves the same

avatar image Bunny83 jonavuka · Oct 18, 2017 at 08:05 PM 0
Share

Well, have a look at the event execution order, especially the flowchart at the end. By default the animation update is executed after all Update methods have been called and before the LateUpdates are called. "animation update" means that the animation time is increased and the bone positions / rotations are updated. That means if you "read" a bone position in Update you actually read the position from the last frame. Also it means that you can't overwrite a bone rotation / position in Update but you can in LateUpdate.

When Animate Physics is used the animation system is updated from inside the physics loop which actually happens before Update (see the flow chart).

When you said

it still behaves the same

what behaviour are you referring to? Your question is a bit confusing.

avatar image jonavuka Bunny83 · Oct 18, 2017 at 08:11 PM 0
Share

What i mean is that I have a simple script that outputs a bone's transform changes, I have it in fixedupdate, update and lateupdate. So what I should see is only changes between the output in update and lateupdate since it should be updating in between those two functions but I don't see that. When I see the output (from Debug.Log statements) the transforms are changing within fixedupdate, changing between fixdedupdate and update and changing between update and lateupdate. This behaviour happens regardless of the update mode, if I keep it "Normal" or "Animate Physics" on the animator

avatar image
1

Answer by cician · Jan 03, 2014 at 05:18 PM

On each element of animated object you need attached a collider and a rigidbody. Rigid bodies should be set as kinematic. NB: the animate physics option only works for 3D physics (help, vote! http://feedback.unity3d.com/suggestions/animate-physics-2d).

The rigidbodies animated this way properly apply forces and friction on external objects. Without it the colliders just change the position. It may seem OK at first look because other rigidbodies get pushed out by the physics engine, but the result is incorrect.

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

22 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

Related Questions

Is there a way how to use both Animate Physics and Unscaled Time update modes in animator ? 0 Answers

2D: Animate physics doesn't work with Animator? 0 Answers

In Profiler: What is "Animator.SendTransformChanged" 0 Answers

Animator not playing onCollisionEnter. 3 Answers

Interaction with object after animation 0 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