Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 Damocles · Dec 01, 2012 at 12:43 PM · physicsragdoll

ragdoll disappearing when off screen

I have a weird problem where whenever a ragdoll goes off screen, it vanishes... kind of. What I have discovered is that it actually teleports around 1000 units away into empty space.

This happens every time I pan the camera so the ragdoll is off screen. I have tried setting the skinned renderer to update while offscreen, but that did not fix it.

The strange thing is - it only happens in real time. If I step through then it remains in place even when off screen. The moment I return to real-time, off-screen ragdolls shoot off to another location.

It has to be some weird physics glitch, but playing with the physics settings (increasing solver iterations, etc) has not fixed it.

Does anyone have an idea what might be causing this?

Update: I've noticed that if I move the camera so the ragdoll is off screen, but immediately move it back on-screen, so it's only off screen for a split second, then the ragdoll is bouncing upwards. So it looks like what's happening is that the ragdoll physics are deciding, when off screen, that some kind of intersection is occurring causing the character to deflect upwards...maybe.

This is odd though as the only thing it's interacting with is the floor, which is a static flat surface. Also, the ragdoll is asleep by this point, so there shouldn't be any updating going on until something hits it. Very weird.

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 Damocles · Dec 01, 2012 at 04:46 PM 0
Share

Hmm, I just found a "solution" but it seems like it should not be the solution, so I'm not going to make it an answer just yet.

In the attached Animator, if I change Culling $$anonymous$$ode from "based on renderer" to "always animate" it fixes this problem. This makes no sense though as the Animator is disabled when switching to ragdoll mode.

avatar image 0tacun · Feb 01, 2014 at 12:39 PM 0
Share

I ran into the same problem... it still occures to me, any fixes?

5 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by foreverplane_unity · Jan 21, 2020 at 02:50 PM

Solution found: just set proper hips position like : animator.GetBoneTransform(HumanBodyBones.Hips).transform.position = animator.transform.position; Right after turn on animator will fix this bug.

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

Answer by Tomi-Tukiainen · Feb 06, 2013 at 12:08 PM

The same problem here. Seems to be related to the Mecanim Animator component.

I used the legacy animation system with culling mode set to "based on renderers". My ragdolls instantiated and stayed at the correct places despite of being on screen or not.

Yesterday I migrated to Mecanim and these problems appeared with animator culling mode set to "based on renderers":

  • if a ragdoll is instantiated for a character off-screen, it will instantiate at (0,0,0)

  • if a ragdoll goes off-screen, it will move to (0,0,0) and take a pose in the animation

When using animator culling mode "always animate", everything works. But it creates a lot of processing overhead as we have ~100 active characters in the level.

Our solution was to use Always Animate and disable animator component with code when AI character goes off screen and re-enable when they become visible again. There's unity callbacks for these. We had some small issues as the animation state is not correct at re-entry but we were able to resolve this with some minor coding..

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

Answer by Netsu · Dec 01, 2012 at 05:40 PM

I have the exact same problem, I also have an animator and a ragdoll and I disable the animator when the ragdoll kicks in, but still the ragdoll glitches and gets shot upwards when it goes offscreen.

It seems to have been fixed when I connected the ragdoll to the main GameObject (containing the animator and a separate collider that is switched off when ragdoll is enabled) it belongs to by a joint.

So my GameObject looked something like:

 > Dude (contains animator and collider)
 > - ragdoll root (with own colliders)

and now it looks like this:

 > Dude (contains animator and collider AND a rigidbody connected to ragdoll root by a joint)
 > - ragdoll_root (with own colliders)

it SEEMS to have fixed it but I am not sure.

EDIT: Nevermind, it didn't help.

Comment
Add comment · Show 2 · 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 Damocles · Dec 01, 2012 at 06:11 PM 0
Share

Interesting that it seemed to fix it for you (if only temporarily). It was one of the first things I tried (adding an RB and collider to root object) but it had very weird results for me. It made the model vibrate up and down extremely quickly - I think it was trying to shoot off like before, but the root object RB was forcing it back into position next frame. It was very odd.

Have you tried changing the Animator.Culling$$anonymous$$ode like I said in my earlier reply to myself? Does this fix it for you?

avatar image Netsu · Dec 01, 2012 at 06:54 PM 0
Share

Yes, indeed changing the culling mode does help, even though I also disable the animator upon enabling ragdoll.

avatar image
0

Answer by MaskedGibbon · May 03, 2017 at 07:38 AM

Same problem.

It's probably considered bad form to "necro" a five year old question, but I just ran into this very problem, and I wondered if there was a fix.

The position of the hip bone from animator.GetBoneTransform(HumanBodyBones.Hips).position seems to be completely unreliable if animator culling is turned on ("Cull Update Transforms"). If "Always Animate" is the chosen option, then it works perfectly fine, but I assume there's a large performance overhead involved with that unless you're careful to turn AI characters on/off at some distance (probably good practice anyway).

Or, is there another way I can get the hip bone position that might actually be accurate?

Comment
Add comment · Show 1 · 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 Tomi-Tukiainen · May 03, 2017 at 07:54 AM 0
Share

Our solution was to use Always Animate and disable animator component with code when AI character goes off screen and re-enable when they become visible again. There's unity callbacks for these. We had some small issues as the animation state is not correct at re-entry but we were able to resolve this with some $$anonymous$$or coding..

avatar image
0

Answer by SmokeExotik · Oct 02, 2021 at 11:26 PM

Go to your skinned mesh renderer, and check "Update When Offscreen",Go to the main skinned mesh renderer, and check "Update When Offscreen"

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

17 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

Related Questions

Collision with rigidbody inside a gameobject 0 Answers

how can i attach a ragdoll to my vr controllers,attaching a ragdoll to vr controllers, ragdoll is behaving sparaticaly 0 Answers

Ragdoll bouncing towards the initial position after disabling animation 1 Answer

How to set up a 3d active ragdoll ? 0 Answers

Character pick up Ragdoll 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