Simple question :)

Hi, I am new to Unity and I’d like to make an object to move with another 0.20 units far from the first object(local direction) so I use transform. position.x + 0.20 (for X and Z too). Yes it follows it but in world directions :(. How can I change it :slight_smile:

Thanks for reply!

transform.Translate(transform.TransformDirection(Vector3.forward));

transform.position += transform.forward * (units per second) * Time.deltaTime;

transform.(forward, left, right) is always in local coordinates.
You can also use transform.TransformDirection, but if you’re just going to use Vector3.forward as the argument it’s much simpler to use transform.forward.