In my script, I have on Input.GetMouseButtonUp(0) set rigidbody.isKinematic to false. But, my object does not work properly. In the inspector isKinematic changes to false, but gravity doesn’t affect it. When I change it in the inspector, however it works.
How can I fix this?
EDIT:
Code:
if(Input.GetMouseButtonUp(0)){
jarInst.collider.enabled = true;
jarInst.rigidbody.isKinematic = false;
jarInst = null;
}