Download

Draw a Trigger Box Between 2 Locations

I’m currently creating a strategy game where I want to be able to drag a selection box by holding the mouse button and moving the mouse. My current idea is to save the location where I press the mouse button (get hit result under cursor, break hit result, get location) and do the same thing when I release the mouse button. Now I have 2 location vectors and would like to spawn a trigger box between them that can than select my units via “Get Overlapping Actors”. However right now I don’t know how to draw a trigger box between 2 given locations. Any idea? “Spawn Actor” just takes 1 Location, Rotation and Scale so I guess I can take my first location as the location and then calculate rotation and scale somehow.

interesting question :slight_smile:

for position, I’d suggest getting the location halfway between your two location vectors

for rotation maybe use Find Look at Rotation node from your first location vector to second location vector

for scale, perhaps use the distance between the vectors