I have some Glowstick items my character can throw and I want to be able to pick them back up, adding to my value in a widget. My code so far isn’t working, so how can I hook it up so it adds 1 glowstick back to my widget? (My widget counter already works though)
it adds 1 glowstick back to my widget
How do you subtract it in the first place then?
That’s not subtraction. You never subtract it then? How does the number go down?
Normally you’d:
To either add or remove one. You’d work in a conditional and a clamp, too, ofc.
Also, since they are items, shouldn’t you be using integers?
The issue is here. You have 2 separate variables to track 1 thing. One is in the character, and another one wherever this blueprints is. Perhaps it’s a matter of dragging the wire from Character Reference and getting the correct Glowstick Amount
variable.
Create a similar function in the character and call it when you pick it up. Just ensure you’re mixing variables up:
What is this blueprint?
That’s my crap trying to figure out what to do before I came here.
my crap
There’s a couple of fundamental issues, probably stemming from tutorials that teach the same flawed approaches over and over again. Consider the following:
- flag a text block in the widget as a variable, do remove any binding it may have:
- in the character:
You can replace the overlap with the interaction thing you have, ofc.
- you can update the amount freely
- fewer variables to keep track of
- the widget updates once - when you collect and drop - rather than 120 times per second