[Blueprints Q] Best way to reference all static meshes in a level?
I'm trying to hide / show all Static Meshes in a particular level for multiple levels. My logic decides which one(s) should currently be visible ingame.
Previously in UE3 you could set an entire level to be visible / invisible. However you can't in UE4 so I'm trying to add Static Meshes to arrays specific to their levels. I can't find a way of finding out which level a particular Static Mesh is in though. If I use the 'Get All Actors Of Class' node it will get all Actors in all levels, not just the current level.
I'd prefer not to have to add a reference to every individual mesh in each level graph and maintain that list as meshes are deleted & added.
Any ideas on how to achieve t his?
asked Mar 25 '15 at 11:04 AM in Blueprint Scripting
If you spawn your enemies in code you can easily add a variable to each instance that tells what level it is part of, that way you can get all actors of class and compare this variable to whatever level you're interested in.
It's not pretty but it'd work. Making the same variable public would work too if you place your enemies manually.
If you have code that uses an 'open level' command you can store this variable as well and use it when the actors are spawned.
I'm not aware of any other solution but there might be, it'd be easier than maintaining a list of actor references at least! :)
answered Mar 25 '15 at 03:38 PM
I don't know if you still need an answer for this, but you can use World composition to split all your actors,meshs and everything up by "level, then simply make each level of objects visible or hidden (or unloaded/loaded). Just pick a level, go to world settings and click enable world composition, and it will add the other levels to your scene. then using blueprints you can choose when to load or unload huge sections at a time.
In my level I have two versions of the same map and by pressing a button i can unload and load entire levels of different meshes, while my character stays in the same place.
Reply to this if you want me to go into more detail, if you still need a solution.
answered Aug 27 '15 at 02:10 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here