Lerping in One Direction

Hello,

First, my code:

hero.transform.position = Vector3.Lerp(hero.transform.position, Vector3.forward, Time.deltaTime);

What I want to do with this is move the GameObject from point A to point B. A simple transform.Translate WORKS, but Linear Interpolation is where it’s at (especially when dealing with forces)

Using hero.transform.Translate(Vector3.forward * Time.deltaTime); I can make the GameObject move exactly forward which is what I want to do.

When I try to Lerp it, however, I don’t seem to go forward; I get thrown back, actually, regardless of the rotation of the GameObject.

Originally I thought the “smooth interpolation” from point A to B would cause this, but I’ve tried it both keeping the object’s rotation constant and irregular. Both times I get stuck with this.

Any help would be great… or even a better understanding of what would need to be done to fix this. I just don’t see why one would work very well while the other one would completely suck.

Vector3.forward equals to Vector3(0,0,1), which is not the position at which you want to have your gameobject. You could use (transform.position+transform.forward) to get a position that is exactly one unit in front of your object. (It might be transform.position-transform.forward , didn’t get to test it)