Announcement

Collapse
No announcement yet.

View added actor component variables at runtime?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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?

    #2
    For stuff like that i usually use print (with object name to string or something that tells me what is source of message), sometimes i make umg widget that displays information.

    For recent project, i made quite complicated debug system:
    - umg widget that displayed sender name and message.
    - umg list that hold above message widgets, and spawned new one for each new sender
    - event dispatcher in gamemode that umg list hooked to.
    - and finally for every variable i wanted to watch i called that dispatcher.
    Yes quite complicated for just debug, but i could see every variable in real time without clicking on different panels etc.
    But after you make it once, you can migrate that debug blueprint to another project.

    Or try Visual logger (which is very powerful and advanced, but harder to learn, about same overhead time as making above umg system): https://docs.unrealengine.com/en-US/...ger/index.html
    Last edited by Nawrot; 10-07-2019, 05:19 AM.

    Comment


      #3
      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.

      Comment

      Working...
      X