Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Enabling collider while a rigid body is within its boundaries cause the rigid body to fly

Discussion in 'Physics' started by Stranger-Games, Jul 30, 2020.

  1. Stranger-Games

    Stranger-Games

    Joined:
    May 10, 2014
    Posts:
    393
    Hi,

    My character has some colliders that I don't want to affect the enemies if he is rotating and not moving. The reason I want to do that is to prevent the enemies from flying due to high speed rotation of the character. So what I did was disable those colliders unless the character is moving.
    But when the colliders are disabled during character rotate the enemy can enter within the collider boundary within this time then when the character starts moving and the colliders are re-enabled while the enemies are within the collider they understandably fly with very high speed.

    Is there a better solution?

    Thanks for advance.
     
  2. Stranger-Games

    Stranger-Games

    Joined:
    May 10, 2014
    Posts:
    393
    My bad. It doesn't seem to fly because of suddenly enabling the collider which the enemy is within its boundaries.
    Enabling the collider seems to just move the enemy to the edge of the collider.
    It has to be something else that causes the enemy to fly with high speed.