简体   繁体   English

Unity Collisions-isKinematic允许对象通过

[英]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. 当未选中isKinematic设置时,它将以这种方式工作。 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. 当我关闭isKinematic时,用户可以在不应该发生的刚体上导航。 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 + Collider
  • RigidBody (isKinematic) + Collider for the static object 静态对象的 RigidBody(isKinematic)+对撞机

So basically you are missing the Colliders to avoid GameObjects go through each other 所以基本上您是想念Colliders以避免GameObjects相互穿越

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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