Download

View added actor component variables at runtime?

Would anyone happen to know how to expose a actor component to the editor interface when running a simulation of a game?

When making sure something is holding the correct results to changes, I make variables in a actor public. Then when simulating the game, I check the actors and their public variables for what’s changed at runtime. Now I’m beginning to work with actor components that are added to a character at runtime, and I want to check to see the public variables of runtime-attached components, but they do not seem to show up in the editor’s world outliner, nor in the character’s outliner of components.

Is there a setting that I can toggle which will show me newly attached actor components at runtime?

Ah, thank you for the response!
Normally, I do use print messages and UMG widgets for debugging UIs, however I’m currently working with odd to display variables like maps containing hundreds of keys leading to struct values where I need to see both keys and struct contents of a very specific actor I’m interested in, so I couldn’t think of a viable way to make a widget or use print strings for it. (It doesn’t help that my focus changes frequently, and to very different, but related things.)

What I ended up doing was making a actor component I named “VariableDebuggingTickUpdater” and attached it to the GameMode in the editor. Its sole purpose is to cast to a target I can’t see and copy its variables to something I can see in the editor with an update every tick.

Normally, I avoid tick events because most things don’t need to be evaluated every frame. This was one instance where it was helpful to use a tick event, but to avoid overhead later by forgetting to turn it off, I’ve made it editor only. I have also added a print message with a very long duration that reminds me that I have it attached to the GameMode controller, so I can remove it when its no longer needed.