How to move an actor towards the character

Hello,

Simple and to the subject,

I want to create an actor , e.g. a box that is like 10 units near me and to move exactly like me, when I move left, to stay at the same distance to me.

I want it as an enemy that will copy my moves.

Thank you.

and what about situation, when it can go like this because obstacles for example? You need always this same position or depending on design, with some ai?

If you just want it to move the same as you but be a set distance away, try attaching the box to the player. That way, then the player root moves, it will move all attached objects in their relative space.

If you want it as a seperate entity, you will need to add the same offsets to the object as you do when you move.
Basically, when you move your actor forward 10, you then need a reference to your box and move that forward 10 too.