Score not updating

Hi everyone, I just started with UE4 today. And watched 2 video tutorials. First is about simple shooting game and the second is about adding score when successfully hit an obj. Here are the videos links:

  1. Unreal Engine 4 Tutorial | Simple Score / Point System - YouTube
  2. Git for UE4 / Unreal Engine 4 - YouTube

My problem is the score is not updating at all.

here’s the blue prints :

I’d put some print strings in to see exactly what is/isn’t running. Especially after the casts.

In the EvilPawnCube, you Destroy it and then ask it to access Game Mode. It probably cannot cast since it’s being destroyed.

Add score first, and then destroy.

super thanks, I understand what you are saying. Unfortunately I’m totally new so I don’t know how to do it !

@Everynone hit the nail on the head, you’re destroying the evil cube before it’s had a chance to update the player. Update the player, THEN destroy the cube:

super thanks for the response. Actually, before posting the question the first thing I did was changing order as you suggested! but it didn’t work. just to verify I tried again but same issue.

I uploaded my project to github : https://github.com/AlineJo/EvilCube.git

Super thanks, problem solved! I just review nodes and found there is destroy actor and destroy component.

I moved my cast and let it execute before destroy component function.

this solution also works THE SCORE is updating, but if you stop the game an error msg will show up. any way I solve the issue, already super thanks to you.

First thing, make this connection:

In fact then, to get rid of the errors, it should go like this:

See what I said below… :slight_smile:

Here is the final solution I came up with, thanks to help from @ClockworkOcean and @Everynone

oh, sorry… actually I just saw it XD … cheers!

if you have time please share the full node map just to make sure. super thanks in advance.

That is the whole thing.