Problem with AI and grenade(addExplosionForce)

so I was following a game creation series and decided to go of course to add my own things and I added a grenade and here is my following Grenade script which is attached to the player:

using UnityEngine;
using System.Collections;

public class Grenade : MonoBehaviour {

    public Rigidbody grenade;
    public Transform throwPoint;
	public float throwPower;
	// Use this for initialization
	void Start ()
    {
        grenade = grenade.GetComponent<Rigidbody>();
	}
	
	// Update is called once per frame
	void Update ()
    {
        if (Input.GetMouseButtonDown(1))
        {
            Rigidbody clone = new Rigidbody();
			clone=Instantiate(grenade, throwPoint.transform.position, throwPoint.transform.rotation)as Rigidbody;
			clone.velocity=transform.TransformDirection(Vector3.forward*throwPower);
        }
	}
}

and heres my explosion script which makes the explosion happened and it is attached to the grenade prefab:

using UnityEngine;
using System.Collections;

public class Explosion : MonoBehaviour {

	public float radius;
	public float power;
	public float explosiveLift;
	public float explosiveDelay;
	public Transform explosionPrefab;
    public Collider[] colliders;
    IEnumerator	Start () 
	{
        yield return new WaitForSeconds(explosiveDelay);
        Vector3 grenadeOrigin = transform.position;
        colliders = Physics.OverlapSphere(grenadeOrigin, radius);
        foreach (Collider hit in colliders)
        {
            
            if (hit.GetComponent<Rigidbody>())
            {
                hit.GetComponent<Rigidbody>().AddExplosionForce(power, grenadeOrigin, radius, explosiveLift,ForceMode.Impulse);

                Destroy(this.gameObject);
            }
        }
    }
}

so after I throw my grenade and let it explode and effect my enemies what happens is that my enemies propel back which is expected but what isn’t expected is that when they propel back they become glitch and start vibrating and moving very slowly and another thing is that when they attack me they fall right through map.
if u require more information ill be happy to provide it :slight_smile:

How are the enemies moving towards you? Navmesh movement combined with rigidbodies seem to cause problems like this quite a lot.

It sounds like when the enemies are being pushed back by the grenade force they are still trying to move forward towards you. You should add a condition to their script that stops them from moving when they have been hit by a grenade blast until the knockback effect has finished.

Not sure the cause of them falling through the map on attack but it sounds like it is probably because their Y position is affected by the attack (due to animation or colliding with the player perhaps). If the collider is pushed beneath the ground they will obviously start to fall through it. If you can’t directly address the cause of the problem then manually setting their Y position back to what it should be when it starts to decrease too much is a temporary solution.