I’ve been making a plants vs zombie clone with some tutorials but I found my zombies when they got backed up against each other started rotating and going off at funny angles.
I fixed the problem by using a slider joint 2d and constraining the angle but while trying to figure it out I came across…
Rigidbody2D.freezeRotation
Rigidbody2D.constraints
RigidbodyConstraints2D
I was wondering if using one of these is a more efficient way of doing it, what’s the difference and how do they work as the API doesn’t have any examples?
I’m guessing it’s something like… this.GetComponent<Rigidbody2D>().
but I’m still learning so I’m not quite sure.
Thanks for any help!