How do I get all actors of the level blueprint?

I need to change the values of a variable I have defined in the level blueprint with a widget. How do I get all actors of the level blueprint?

Hi @HariPrasad

Ok if i understand your correctly you have variables decalred inside your level blueprint and you want to access them programmatically instead of direct ny their names?

If so then that may be an issue as im not sure but i dont think you can search for all variables except i guess possible using some custom c++, but you did say blueprint.

One way is to store all your variables into a map, that has a key and a value pair but then each time you need to access them you would need to access the map variable and find the key/pair not the variables direct.

Also on that not im not sure if the map variable allows different data types for different keys on the same map object.

Can anyone else touch on this?

  • register dispatcher in the LB, call it in the widget:

  • if you really want ALL, choose Actor as class:

If some of them are spawned dynamically, change their tag and Get All Actors of Class with Tag instead.


Can anyone else touch on this?

@High500 I sense there’s like 12 gotchyas here that are yet to be mentioned. :eyes:

:see_no_evil:

you read the part about actors differently to me i was focused on level blueprint rather than level itself, presumed he meant all the variables without explicitly knowing them. Be interssting to see which he meant. :thinking:

1 Like