How to get all actors that are currently shown in viewport

I’m building an RTS and when the user double clicks an Actor I need to select all Actors in the view port. How do you get all actors currently shown in the view port? What’s the best way to do this?

The two approaches I can think of is:

  1. Use line traces that use the view port corners to draw a box/line trace in the world and get the actors that are in the area of that box.

If this is the approach to take, how would I get the view port corners and then translate them to world locations?

OR

  1. Use a collision component in my CameraPawn actor and resize the collision box on the X & Y axis as the camera is zoomed in/out.

Hi,

Rama’s Extra Blueprint Nodes should have what you need. Take a Look at the Plugin.

I think I found the original answer here How can I check if an object is visible by a camera? - Rendering - Epic Developer Community Forums :slight_smile: