Download

[Problem] Scores on coin pickup (RollingBPExample)

Cant figure out how to get the scores to save and printout have the coin in place and it destroys on pickup

scores1.png

91fd761c0c38804eadbc762e0b232a06c71397a5.jpeg

scores3.png

Why are you using Event Possessed? On Event Begin Overlap, you need to increase the score variable by 1, and then destroy it. The problem is that you are storing the score variable in your coin blueprint, meaning each coin has it’s own score variable. You need to store the score variable elsewhere in order to keep it from being destroyed along with the coin.

the score is stored in the ball blueprint. why would i need to destroy the score variable? you saying i should remove everythign under Possessed i figured since the pawn is not a player i had to call event possessed cast to ball then set it as a “player” to be able to use player var.

Nevermind what I said, I was a bit confused. Call the Add Score event after you destroy the coin.

still not showing my scores.

scores4.png

scores5.jpg

You should do something like OnOverlap -> CastTo<Coin> -> AsCoin Get some-variable-that-says-how-much-the-coin-is-worth -> Plug into Add scores. Destroy actor when you are COMPLETELY done with it.

This way you could also add in coins that are worth different amounts if you wanted to.

Also when using a cast, the top right execute pin won’t fire unless the cast was successful, so no branch is necessary.

Inside of your Add Scores function, connect the exec pins up.