I am unable to figure out why this will not work. I have been trying many different solutions but so far none of worked. What I am trying to do is when I collect an item which will Destroy the component actor, it will add 1 to the “Collected” int value. The Int value will then update the text value which will be displayed on the HUD, but the value displayed remains 0 despite the Int value being 1. I have bound this function to the text box, I have tried casting, calling functions from another BP.
*Quick other question, while trying to figure it out again while typing this out, upon pressing E it is no longer adding any value to the “Collected” variable.
Please help, I am stressing too much.
Thanks in advance
Sorry, did not me to dupe question
Some strange things here.
A)Why is there no return node on your collect item function. EVERY function has to have a return node. It it has no return node, it should be an event, not a function.
B) Unless I am mistaken, you will need to use a Cast To node in your UMG function to get the value, or you will need to use interfaces and an interface call to return the value.
Well it doesnt need a return node to be a function. You only need the return if you want to output a variable from the function itself. Useful if reusing it. You can also just reuse the variables set from inside the function manually by getting the varaibles elsewhere rather than dragging off the return node output of the function. I make functions like this to keep the event graph cleaner all the time.
for the umg, try setting it up something like this instead.