Is there a way to add Object Variables to an Object with the Object Variable Component in a running game?

For example I have a Cube Object that starts with no Object Variable Component on it, but does have a TIck Machine on Update.
This Tick Machine checks if the an Object Variable Component Exists.
If True wait 1 second and remove this Tick Machine.
If False Add Component, Object Variable Component.

Now that the Object Variable Component is attached to the Cube, it has no Initial Object Variables.

Is there a way to add/set/remove variables to appear in the Object Variable Component list?

The reason I'm doing this is I found that when the Object Variable Component is attached during gameplay it generates a new Object ID and that is ultimately what I want. But I can't figure out how to add in the Variables to the Object Variable Component during gameplay.

Unless there is a easy way to generate a New Object ID on the Object Variable Component during gameplay via Schematic Nodes that I'm not seeing?

Any help is greatly appreciated!
  • Use an Add Component node to add an ObjectVariablesComponent component to the game object. You can set the objectID field (string) using a Change Fields node, generating a random object ID (like in the editor) isn't really possible.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on!
Sign In or Register to comment.