c# - Unity 3D setting rotation and still use rigidbody -
i have been working on rts game , working on unit movement now. have finished path finding unit spacing, coming across big problem: when units (tanks in case) go on incline, stay parallel ground because setting rotation based on quaternion.lookrotation(distancetodestination);
can rotation.
is there way can rigidbody behave , still set unit's rotation?
you have 2 simple-to-implement options.
- add enclosing empty playing role of rigidbody. allow lookat child item without affecting trajectory of main object.
- lock rotation of rigid body using constraints , manually override z axis normal of contact point; , y axis target's inverse vector.
hope helps.
Comments
Post a Comment