- Home /
Align line of units based on vectors
Hey
We need to make a line of units that is phasing a specific position. We've got so far the correct direction where the line is in our case, but are struggling with how to make the whole line of units rotate according to the target position. How this can be made? We can't use transform functions as when the unit line is calculated none of the units are visible.
Situation we have now, the blue units are the ones attacking the green units. Everyone's center of spawn is in the middle of unit row
The locations of those units are set by the player and they're set from (0,0,0), so the left side unit's around (-45,0,0) and the right one is (30,0,0) in this picture when each unit have 15 in distance.
How are we able achieve this? The solution should be able to handle also situation where player has set those units in some different formation than row if possible. Thanks in advance