Check out example codes for "rigidbody2d freeze position". It will help you in understanding the concepts better.

Code Example 1

public Rigidbody2D rb;

void Start()
{
	rb.constraints = RigidbodyConstraints2D.FreezeAll;
}

Learn ReactJs, React Native from akashmittal.com