Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
This question was closed May 09, 2019 at 06:32 PM by Kim-Nobre for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by Kim-Nobre · May 03, 2019 at 09:14 PM · collisionphysicsragdoll

Why is my ragdoll reacting differently depending on the framerate?

60 FPS reaction:

alt text

30 FPS reaction: (This is what I want to happen)

alt text

What's happening:

I'm shooting an object using "AddRelativeForce" with the "VelocityChange" force mode. When the object hits a bone of the character, it disables his "Animator" component and adds force to the bone's rigidbody.

The problem:

When the game is running at a high framerate the reaction to the collision becomes very weird.

So, how do I get more consistent results independently of the framerate?

collisionat60fps.gif (512.4 kB)
collisionat30fps.gif (476.0 kB)
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

2 Replies

  • Sort: 
avatar image
0

Answer by Rugbug_Redfern · May 03, 2019 at 09:38 PM

Well, I would have to see your code to know for sure, but my best guess is that you are applying physics in the Update() function instead of FixedUpdate(). You should always run physics in FixedUpdate() as it get's called (by default) every 0.02 seconds, regardless of framerate. Update()gets called every frame.

So if you have any physics in an Update() function, move it to FixedUpdate().

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 Kim-Nobre · May 03, 2019 at 10:03 PM 0
Share

Only the character movement is in Update(), but I'm using CharacterController ins$$anonymous$$d of Rigidbody. Either way, I'll put the movement in FixedUpdate() and see what happens.

avatar image galactichyperstar Kim-Nobre · May 04, 2019 at 03:31 AM 0
Share

So, how do I get more consistent results independently of the framerate?

Like the answer said, use FixedUpdate since it's dependent on time ins$$anonymous$$d of framerate like Update is.
avatar image Kim-Nobre galactichyperstar · May 06, 2019 at 01:05 PM 0
Share

Ok, so I tried to use FixedUpdate in the character movement, but unfortunately the results are still the same. So maybe there is something wrong with how I set up the ragdoll or how I'm applying force when the collision happens.

Show more comments
avatar image
0

Answer by Kim-Nobre · May 06, 2019 at 05:34 PM

Well, I'm still not sure what exactly was happening there but, the solution that I found was to set the "IsKinematic" property of the bones' Rigidbody on or off whenever I activate or deactivate the Ragdoll. Now the collision reaction seems correct and consistent.

alt text


adjustedragdollcollision.gif (338.2 kB)
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

Follow this Question

Answers Answers and Comments

208 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 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 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 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 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 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 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 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Character animation/ragdoll problem 1 Answer

Ragdoll collision precision 0 Answers

Stop ragdolls from colliding with each other? 2 Answers

How do I solve the Box Collider (3D) Edge / Corner Collisions problem? 5 Answers

Rigidbody is behaving abnormally when transformed manually 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