Moving an object based on another object's forward vector

I’d like to move objectA by 5 units in the direction of an objectB’s local forward vector. I’m betting the solution is fairly simply, but it’s eluding me. Any help would be most appreciated,

Thank you!

Here’s a couple of examples based on manipulating the transform directly (untested):

A.transform.position += B.transform.forward * 5;
A.transform.Translate(B.transform.forward * 5, Space.World);

If you’re using a rigid body or character controller, you’ll most likely need to use a different method.

This helped out, thanks a lot :slight_smile: