简体   繁体   中英

Unity Collisions - isKinematic Allows Objects to Go Through

I have a user navigating and colliding with a rigid body. I would like one object to slide along the other when the collision happens. It behaves this way when the isKinematic setting is NOT checked. However, the object then moves. I would like the object to stay in place when collided with. When I turn isKinematic off, the user is able to navigate through the rigid body which shouldn't happen. Any ideas on how to fix this?

As of now, I don't have any scripts associated with the rigid body.

If one object is moving and the other should be static:

  • RigidBody + Collider for the moving object
  • RigidBody (isKinematic) + Collider for the static object

So basically you are missing the Colliders to avoid GameObjects go through each other

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM