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.

  1. add enclosing empty playing role of rigidbody. allow lookat child item without affecting trajectory of main object.
  2. lock rotation of rigid body using constraints , manually override z axis normal of contact point; , y axis target's inverse vector.

hope helps.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -