Hello, I’m trying to figure out a way to disable my player object from spinning when it hits something. I just want my PlayerControls script to be the only thing rotating it.
Enable “Freeze Rotation” on the Rigidbody2D constraints. This won’t allow you to apply angular velocity or torque though so you’ll then be forced to explicitly set the rotation via Rigidbody2D.rotation.
Ahh yes, I forgot that my rotation script edits the transform of the object so I don’t really need the rb2d for it to make it rotate.
You do if you’re using a Collider2D. Colliders don’t move, Rigidbody2D do and colliders are attached to them. Not having a Rigidbody2D means the collider is implicitly created against the hidden Static ground-body so modifying the Transform means it has to be completely recreated each time.
Add a Rigidbody2D and set the body-type to Kinematic or Static if you don’t want any collision response on it. Then you can just set the Rigidbody2D.position or Rigidbody2D.rotation.