Freeze gameobject with a collision

Hi! I have a enemy that launches a projectile, what I want to do is this, when the projectile collide with the player or the weapon, stay still, but I have tried with “RigidbodyConstraints2D” but not work. How could I do it? Thank so much! :slight_smile:

137663-2.jpg

You’re using a kinematic body so it’s ignored by the physics engine. You need to stop rb2d.MovePosition by using a boolean that equals true when the trigger happens.

bool projectileTriggered;

void FixedUpdate ()
{
    if(!projectileTriggered)
    {
        //MovePosition...
    }
}

void OnTriggerEnter()
{
    projectileTriggered = true;
    //other code
}