It always crash when I try to call Rigidbody2D.Closest2D() and the rigidbody’s gameObject is inactive.
Sample:
public class CrashScript : MonoBehaviour
{
public Rigidbody2D body;
// Start is called before the first frame update
void Start()
{
Debug.Log("SetActive(false)");
body.gameObject.SetActive(false);
Debug.Log("ClosestPoint()");
body.ClosestPoint(Vector2.zero);
}
}