• 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 DGordon · Sep 04, 2014 at 04:07 AM · animationphysicsfpscolliderslimbs

Raycasting colliders moved by Mechanim animation?

Hello all,

I'm trying to create a system where I can damage specific limbs on a model (specifically by bullets, but not really relevant). I'm attempting to do this by attaching colliders to the bone structure, and then using RayCasts to determine if a limb was hit. However, any collider attached to a bone that has been moved by an animation (mechanim Animator) is out of sync with the physics engine -- the raycasts simply don't hit the colliders. Am I going about this wrong?

My model's are using Mechanim animations with colliders attached to the bone structure. The majority of the colliders were created using the Rag Doll wizard, with a few others added manually (hands and feet). Only the Rag Doll colliders have rigid bodies. All rigid bodies are set to kinematic through the checkbox in the editor. This does not change until the model dies, at which point I disable the Animator and enable kinematic on the Rigid Body so the model enters Rag Doll mode.

The issue is that any collider moved by the animation has its hit box out of sync with the physics engine. This applies to all colliders regardless of if it has a rigid body or not. How do I get the colliders which have been moved by an Animator to be hit by raycasts? Plenty of games have this functionality ... I don't think I'm trying to figure out anything too crazy here. I'm just clearly not attempting it in the right way within Unity ... I just don't know what I'm missing though.

Is there some way to get the colliders to be in sync with both the animation and the physics engine, or should I be attempting this functionality in a different way? This has been holding me up for almost a week now, so if anyone has a solution, I would really really appreciate it :).

Thanks again, Dale

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

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

2 People are following this question.

avatar image avatar image

Related Questions

Referencing the Collision of two other objects to allow for an animation to be played on the scripted object. 2 Answers

Blender animation into unity problems 1 Answer

Unity Animation Causes Clipping 0 Answers

Complex Animated mesh and Colliders 1 Answer

Physics colliders don't follow 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