Hello! I’m currently trying to reproduce the RTS mechanic of selecting multiple units with a draggable rectangle. To accomplish this I want to use Multi Box Trace by Channel. To get the half-size / center coordinates of the box I am getting a vector at the beginning and end of my drag using get hit result under cursor and taking the location of the hit. I have a macro that turns these into the center position of the box. Here’s the macro. Basically gets the center of the box by getting the median x/y and adding those values onto the start vector to get where the center should be. The half-size is the same without adding them onto the original vector.
And I use these in my controller to create the trace box on the release of the mouse button. (The end is just a point right next to the original start point to keep the box shape)
This only works when going from the bottom of the screen to the top. I have absolutely no idea why. The box is drawn correctly no matter which direction I drag from but I only get hit results when I drag from the bottom to the top. Here’s an illustration.
When I rotate my camera to view from the opposite angle, I weirdly can only select from right to left. I do not understand this behavior at all. I think it’s probably something with my math but since it’s drawing the boxes correctly and the characters are in the boxes in all of the directions I don’t understand why it’s not seeing them as hits. My characters are set to block visible channel.
Any ideas would be greatly appreciated!