Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    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:
    315
    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:
    315
    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.
     
unityunity