• 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
2
Question by Ves · Sep 17, 2011 at 08:41 PM · collisionrigidbodykinematic

Collisions with Rigidbodies with Kinematics

I can't seem to find a specific answer for this. Mainly, I have an enemy rigidbody in my game who, when hit by an attack of some large value, goes ragdoll (isKinematic = false). However, when he is chasing the Player with isKinematic = true, he phases through terrain and such.

Is there an elegant way of having an enemy be allowed to go into ragdoll and still collide with the environment?

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

3 Replies

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

Answer by Bunny83 · Sep 18, 2011 at 12:09 AM

Actually the only two components that can detect collisions are: the CharacterController and a non-kinematic RigidBody without any exceptions (afaik). However the CharacterController uses it's own detection method and is not really part of the physics system.

The only difference between a simple GameObject with a collider and one with a kinematic Rigidbody attached is that the kinematic Rigidbody can wake up other non-kinematic Rigidbodies. Non-kinematic Rigidbodies fall asleep after a few seconds. They can only detect collisions when they are awake. If you move a GameObject with a sleeping Rigidbody it will wake up automatically, no matter what method of movement you're using (transform.position, AddForce, MovePosition).

The only use of a kinematic Rigidbody is that when you move it into a sleeping Rigidbody it will wake up and would perform the collision check. Keep in mind that the collision messages are sent to both objects but only a non-kinematic Rigidbody can produce them.

I'm not sure how your ragdoll-setup looks like, usually you have multiple body parts that are connected with joints. To move the enemy while he's alive you should use either a CharacterController, or a non kinematic Rigidbody. You should remove it when you turn it into a ragdoll.

If you use a Rigidbody you can set freezeRotation to true so the Rigidbody is not rotated by the physics system but you're still able to rotate the object via script. You can also use Rigidbody.constraints to prevent the rotation and / or position change caused by the physics system.

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 vackup · Nov 21, 2013 at 04:24 PM

HI Ves, I had the same problem and here you have how I solved it http://vackup.blogspot.com.ar/2013/11/unity-ragdoll-and-collisions-with.html

Basically It was creating the ragdoll at runtime with a script.

Visit the blog post and you have the detailed intructions and some useful links

Enjoy it

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 wonderkid · Nov 25, 2015 at 03:09 PM

Using 2 colliders and checking one of them "isTrigger" solved my problem

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.

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

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Rigidbody and Parenting - Kinematic Rigidbodies? 2 Answers

Simple Movement Game: Physics vs Manual Collision Detection? 2 Answers

Kinematic rigidbodies 1 Answer

2D motion/collision: physics, or direct translation? 2 Answers

Disable rigidbody from being able to move other rigidbodies 1 Answer


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