Im trying to create a point system similar to cod zombies and I can’t get it to add points after I kill an enemy. It will only add 25 one time and then never do it again. Could someone assist?
Hi there and welcome.
I’m not entirely sure how it works once, but in the Add Money
event you read from a variable called Collected Cash
and add it to the input parameter Total Cash
, suggesting that the Collected Cash
variable is the ‘running total’, but then it sets the result in Total Cash
.
Your UI binding then seems to be pulling out a variable called Total Cash
, so there is some confusion here, and you appear to have both Collected Cash
and Total Cash
variables on your character?
I would have thought the parameter name being the same as the variable Total Cash
would shadow it and the set at the end would be effectively doing nothing (setting the parameter), but the behaviour you describe suggests it is setting the variable, so the problem is presumably the Collected Cash
you are adding onto (always 0).
So, figure out what’s going with Collected Vs Total in your character, and choose a parameter name for Add Money
that is not the same, even if you can (and make it work) it is just confusing matters.
“Total cash” is your input to the event. And you’re storing to it again?
What is “collected cash?”
If “Collected Cash” is the variable in the player state that stores the total amount of cash, you should store into that.
If the player state variable is called “total cash” then your argument in the event should be called something else, you should not be reading “collected cash.”