How to get all visible staticmeshactors?

I am new to game development and Unreal Engine . now, I want to get all the visible objects, or figure out if an actor is obscured or not, Any code or tutorial might help.

Thanks in advance!

I’m new too and learned from the Blueprint Enterprise course in the online learning portal about Get All Actors of Class. Use that function and select Static Mesh Actor. This is going to return an array of objects for which you will need to create a For Each Loop. I don’t know how to proceed from there. There is a Set Visibility option but no Get Visibility option which ends up making a complicated work around if we try creating functions and Boolean variables for each object ourselves. Maybe someone else knows.

Hello jobgeo,

Good job that_lightworker, you are only missing one node. There is a node called IsVisible that will return whether or not the Static Mesh Component of the actor is visible.

The implementation above will find all the Static Mesh Actors, however if you want to find every actor that has a static mesh component you will need to modify the nodes a little bit. Since every actor blueprint can contain multiple components you would have to check if there is a Static Mesh Component and if one was found you have to check if it is visible.


How to find all the Static Mesh Actors

How to find every actor with a visible static mesh component

Thank you , those screen shots are a beauty to behold!

You’re welcome that_lightworker! I’m glad I could help.

Thanks everyone!

This function solved my problem.