Change distance between actors

How can i change distance(or vector length(its the same)) between 2 actors via set actor location or something? I need to make a distance from target to second actor on the picture equal to 180, in any direction depending on the target location.

SecondActor → Set Actor Location( Target.Location + ( SecondActor.Location - Target.Location ).Normalise * 180 )

Assuming you want to move the SecondActor. Switch the names around if you want to move the target.

ugh, doesn’t work, am i doing wrong something?

You may need to swap the inputs to that - node as well.

Thanks, works better now, but i change 180 to -180 and target moves forward to second actor(was moving backward). And now another problem - target moves to second actor on 180 points every time when i press the button, but this distance must be always 180 from second actor to target, how to make this?

Not sure what you mean? It must always be 180? From the moment you begin play to when you stop playing?

Ah. I see what you mean. It looks like you want to disable input while that’s going on. Then enable it when the animation is finished. Rather than keeping your 2 actors a set distance apart.

Almost. I have 2 actors, when i play animation from one actor to another - distance between them must be 180~ instantly, check out video, maybe it helps for better understanding

It will not work, because imagine a situation when 2 actors stands to each other on a distance less than 180, then when i click to play an animation - it will fail position of hands(i mean when they shake hands)(because it is 2 different animations for each actor), so i need to teleport casting actor on a distance equal 180~ from target actor, and only then play animation. =/

So do it like this:

  • Click actor (to start handshake)
  • Move or teleport actor to 180 away
  • Disable input
  • Play animation
  • wait
  • Enable input