How to get an array with all visible actors? (not just on screen)

I want to get all actors that are visible in game within a volume (everything the player can see), so I can code a bp to show/hide them. in other words, I want to ignore stuff like volumes, already hidden meshes, helper actors, etc.

The “get all actors of class” function can filter by either static mesh or skeletal mesh actors, but there’s no class that encompasses everything that’s visible.

I also wasn’t able to use the “get all actors of class” twice to filter both static and skeletal meshes and then append them to a generic “actor” type array, since the out actors come as static or skeleton mesh actors, and not general actors.

I tried using a “get all actors of class” function filtering by just “actor”, and then using a for each loop to check each individual array element if it was hidden in game or recently rendered, but both bools will result every single actor, including player start, trigger volumes, etc. so really everything, not just stuff that I can “see” in game, which is what I want.

Any ideas what can I do?

Hi there

Have you tried this one:


Hope that helps.

Another possible way, you can select all actors of a same group, and add an actor tag. Now, you can get all actors of class with tag or simply get actors with tag.

do you need the mesh? can you not just set the whole actor hidden in game?

what are you trying to achieve?

Heya

I did try it, but for some reason it doesn’t work, it doesn’t return actors that have been recently rendered.

Tags also won’t work in this case because I wanted to need stuff inside that volume dinamically, that means npcs that can spawn inside different volumes, objects that can be dropped anywhere, etc.

I’m just trying to make an array with all the actors, regardless of what kind, that are currently visible in game, so I can script a bp to check, from all visible actors, which ones are inside a volume, so I can hide or show them on begin/end overlap.

use an interface,

get all actors with interface and have an interface function return (isvisible?)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.