title: animating object along a path in unity 3d
body: <p>I need to animate an object along a path. I am doing so by creating an animation like:<img src="https://i.stack.imgur.com/cpU0G.png" alt="enter image description here">. </p>
  
  <p>This works great but since my terrain is not flat it will be nice if I don't have to deal with the y component. In other words I want to move an object along the x-axis and z-axis and if there is a small slope increase then increase the object y position. same thing if there is a downward slope. Or maybe I have to create a script where it checks to see if the object is colliding with the terrain. if not then decrease its y position. I don't know if this will work meanwhile animating an object though.  </p>