如何通过 scrip 将 Kinematic 更改为 Dynamic?刚体2d

How to change Kinematic to Dynamic through scrip? Rigidbody2d

enter image description here

对象有动态。我需要更改为 Kinematic。

var rb = GetComponent<Rigidbody2D>();
rb.bodyType = RigidbodyType2D.Kinematic;

Reference.