Download

How to transform vectors somewhere else by another vector ?

I made a script that makes a form for multiple character pawns. When I click anywhere on land script prepares new locations into Vector array as a square form. That gets center of selected units, then gets direction of this location and right click location. Last, that uses this info to prepare new locations at right-click location. Just like in AoE2 but this script always makes square form rather than rectangle. At this point I need to do something more before I move units. I want to transform those prepared locations to back by base location but I do not know how to transform those Vectors there with plueprints.

Is there a easy way to do it ?

A VIDEO THAT SHOWS HOW MY SCRIPT WORKS: UE4 RTS FORMATION TEST 001 - YouTube

I also added an Image that explains the thing I want to do.

So you want to perform a translation and rotation ( around point ), of an array of vectors? It looks like that’s already happening…

No and yes thats happening but I want to put those locations somewhere else too. As you can see on the image I move them to turquoise color. After this calculation done and I got vectors, I want to make a second vector array move those back into starting location just like on blue image and location is yellow point. At that, I will not need any rotation since first vector array contains rotated positions. Just transforming them to yellow point with same formation is problem form me. My english can be bad and I maybe told it wrong way.

Alright, I found kind of a solution I think. After thinking a little. I made a secondary script. Which is shown here: (1) UE4 RTS FORMATION TEST 002 - YouTube](UE4 RTS FORMATION TEST 002 - YouTube)
In the video you can see target unit locations and base unit locations are shown with white lines. Lines at base location of units were my purpose.

Well that looks great actually… :slight_smile:

Thanks, I still have many tasks to do. Somehow, I will finish it.