жестко, 2D разморозную позицию
public Rigidbody2D rb;
void Start()
{
rb.constraints = RigidbodyConstraints2D.None;
}
Comfortable Capybara
public Rigidbody2D rb;
void Start()
{
rb.constraints = RigidbodyConstraints2D.None;
}
rb.constraints = RigidbodyConstraints.FreezePositionX | ~RigidbodyConstraints.FreezePositionY | RigidbodyConstraints.FreezePositionZ;
rb.constraints = RigidbodyConstraints.FreezePositionX | ~RigidbodyConstraints.FreezePositionY | RigidbodyConstraints.FreezePositionZ;
//to unfreeze a position/rotation put ~ before