How would I go about creating a box selection that goes off of mouse position in world space and not screen space? Both “Draw Rect” and “Get Actors in Selection Rectangle” nodes only work with 2D Vectors created using “Get mouse position”.
“Get mouse position” → “Convert Screen Space to World Space” doesn’t work.
You can get the mouse position in world space at any time, so maybe save it when it’s pressed for corner one and when it’s released for the opposite corner.
From there on you have multiple ways of getting the actors in that box. I’d probably try by spawning a collider box from one corner to the other and getting all colliding actors in it.
For your problem with: “Get mouse position” → “Convert Screen Space to World Space”;
There’s a function called “GetHitResultUnderCursor”, which is basically a line trace onto whatever the mouse is over (FHitResult is used and returns the impact position).
I still can’t believe that this is not a standard feature in Unreal, drawing selection rectangles has been a standard in the design industry for ages. How then do you select a group of objects that have no common qualities but their presence on screen ?
Spit balling, anything you want to be able to select could all share the same parent actor?
Also, I’m not sure but couldn’t you also use the generic “actor” class, and create a custom trace channel? Not sure if the get actors in rectangle node functions the same as the under cursor node and you can break it up and work with whatever blocks said trace channel.