So we were able to load the Canvas into the game upon play by the following:
Create and save the Canvas, point the Canvas to set the Element Id then add UI:Text:SetText
in flowgraph add this to start node, all works fine for static number. Go that
HOWEVER we wish to change the value over a timer, for instance if a number was set to 100 and we wish to subtract this over time to change the string value of the text set, how would we do this?
I will add the FlowGraph we created simply… Created Mission Token for Health and Stamina, then set it to subtract, then set concat to transfer float to string… Works in Debug but not UI??? Any thoughts???
Apologies for the (very) late reply. Hook up the String:Concat “out” port to the “Activate” on the SetText node.
When a node is activated, it executes. In the screenshot you provided, the SetText is only executing when the canvas initially loads (just once).
However, you’ll notice that input ports, such as the Activate port, may only have one input. To work around this, create a new “Logic:Any” node, and route the ouputs of the Concat nodes to inputs of the Any node. Then, the output of the Any node can be routed to the SetText Activate and Value node.
I’ve attached a screenshot to help clarify my explanation. Note that SetText is now activated by the Logic:Any port and not the Canvas:Load (I’ve omitted details in the GameTokenModify node, but you get the idea =).
Also, please make sure that the ElementID on the SetText node is accurate (that is, that’s the Element ID of the UI element containing the text component that you want to set the text on).
However, after reviewing this Flow Graph, this is probably not what you want, either. I’m guessing you want two separate text fields on your HUD, one that shows health, and one that shows stamina?
In this Flow Graph, only one text component is being updated, so you will only see one value represented (or flashing back and forth between “Health” and “Stamina”).
I’m guessing what you want is two SetText nodes. One that gets set based on Health, and one set based on Stamina. In your HUD UI canvas file, make sure that you have two UI elements that contain text components, and note their element ID in the properties pane. Then, make sure that you have separate SetText nodes that sets the text for each.