What am i doing wrong (Adding Points)?

im new to all this and am just learning atm but can somebody point out what i am doing wrong here because it looks like it should work.


collision causes coin to be destroyed (works)
Which then goes through the value 1 adding it to the total coins (problems)
Coins make bar go up and plays a sound (works)

Destroy works best at the end.

You may want to rework that. I think the value bar is having problems because the object is constantly being destroyed. As what Mhx said, put destroy at the very end of everything. I would suggest:

Collision (player) [hit] - :

  1. (+1) keep the number as 0 [OUT] - (value) Bar [out] - destroy
  2. (play) soundEffect

And yes, make sure to connect the sound and coin value behaviors separately, just for the sake of not making the sound dependent on anything.

I’m not sure if the bar will disappear if all of the coins are collected. If it happens, let me know.

ok thankyou ill give it a go now


ok iv got this and im still having problems the first coin i pick up is adding 1 to the total coins the second coin does nothing it shows the collision but doesnt add to it

ahh after ages messing about i have found that if i take the destroyer out so the coin isnt being removed and jump on the same coin the counter goes up, if i jump on another coin the counter resets to 1 as its counting it as new set of coins, so how can i go about it storing the coins somewhere

What you could do is keep the destroyer part and but the collision-coin value-total value- bar in the players behaviors

thank you so much been well annoyed haha it works fine now

glad it works

@scott_taylor1989 I’m not 100% positive if I’m right, but you can get rid of the number with the “coin value” label. When something is connected to +1, regardless of a previous number before it, the number itself should automatically rise by 1. So if you just connected collision to (+1) Total Value, it should automatically go up by 1.

Muphins cheers i have taken it out and it works i am amazed at how many ways of doing things there are TOP NOTCH cheers every1