Check out example codes for "stagnant object in unity". It will help you in understanding the concepts better.

Code Example 1

Rigidbody2D rb;

void Start()
{
    rb = GetComponent<Rgidbody2D>();
	IsStagnant(); 
}

void IsStagnant()
{
	if (Rigidbody2D.Isleeping())
    {
    	Debug.Log("Object is not moving")
    }
}

Learn ReactJs, React Native from akashmittal.com