I was trying to port a small test project from Unity Engine to learn about Unity New Fishers DOTS && ECS.
It's a small project where I have a capsule with a Rigidbody
and I move it from left to right using add force and I clamp the velocity to limit the speed.
I'm trying to "Freeze Specific Rotations" on DOTS.
Without DOTS there is Unity's "normal" way to constraint a Rigidbody
position and rotation.
But if we use DOTS I can't use Rigidbody
since DOTS uses PhysicsBody
and there I didn't find any way to freeze / constraint certain rotations.
How can I constraint a PhysicsBody
's rotation in DOTS?
I was researching the answer to the same problem and managed to to find this on a unity forum.
TRS6123's answer from a Unity Forum
Below the "Advanced" property of the physics body, you can check "Override Default Mass". When checked you can override the float3 value "Inertia Tensor". Setting one axis component to "Infinity" locks the rotation along that axis.
I did what he instructed and it is working like a charm for me right now.