Blueprint Help [Scoring System]!!!!

m trying to create a scoring system. But it’s not working for some reason?? The first image compiler results say " The execution path doesn’t end with a return node. Cast failed. The 2nd image is my pawn class where I spawn the meshes right when the game starts and I put a BP so that when it gets destroyed it adds one to score. The third image is my Player controller BP with me default settings.
I already removed the print string thing. The last image is my error saying that everyone the mesh spawns in the game (the mesh is called thing) and when I destroy it, it can’t add my score. What’s wrong??? Is there a way to fix this or a better way to add a scoring system. I tried searching online everywhere for tutorials for scoring but there not helping??

60658-4.png

For the first picture, that is not an error, just a warning, you need to connect the cast failed to the return node. (It is also VERY unwise to cast every frame like you are doing, that Get Text 0 function is running every tick, so cast once and set a reference).

For the last error, the reason that it is accessing none is that your cast is probably failing every time in the 2nd picture. Try a print string and see if the cast is ever successful. Another thing that you should note is that in the 2nd picture, you are destroying self and then adding score. It is bad practice to destroy the object that still has code left to execute, so you should add the score before you destroy self.

I tried printing a string before doing the widget and its still failed. I should probably add the score before destroying the actor, but I’m not the best in BP. How do you cast once and set a reference so the error won’t pop up. And cast to the return node

Connect the cast failed to the return node. To store a reference after casting, from the ‘As MI’ on your cast, promote that to a variable. You should then move this cast to the ‘Event Begin Play’ area of your blueprint, and then instead of casting once possessed, you can just set the score from the variable reference that you stored.

My scheme.
I created Widget with name Score:

I created BP Class with name Enemy:

In the Third Person Character I created three variables:
PrintScore- Variable type: String;
Score Reference- Variable type: Score->Reference;
Score- Variable type: Float;

Scheme in the Third Person Character:

Continue

Bind in the widget Score in the text 0

IMHO, you can use Event Touch in your scheme=)

PS:Excuse me for my bad English=)

Can Score- Variable type: Float; substitute Score- Variable type: Integer;

PS:Excuse me for my bad English=)

Thanks i’ll try this. So you have your widget that will show score, the enemy is what your destroying so for me ill add that in my 2nd image BP in my post/question. But what about ThirdPersonCharacter BP, where would i put that. Would i put it in Player State

I russian and I don’t understand of question=))Could you put it otherwise?=)Thank you=)

PS:Excuse me for my bad English=)

Sorry but all those example blueprints are quite bad.

Have a look through my posts.About 6 months or so ago I did a full example up here for a target shooting game. It is pretty much exactly what you want.

Thank you, I will consider=) It will be useful to correct their mistakes=) Can you give a link to your example?=))

PS:Excuse me for my bad English=)

Well all I would do is search through my posts to find it…alternatively you could do that…

You can’t link your post to that. How would I go about making a better score system if the other persons BP examples were bad? Could you provide better BP examples for the scoring. I’m not best on BP so I’m in trouble. Thanks for the help!