How to add a scoring system using BP?

What i’m trying to accomplish is every time to destroy a mesh it will add one point to the score and the score text HUD will show at the top of the screen in-game. How do i make a BP like that or is there tutorials for this? Here is my BP for how the player destroys the mesh, it’s a simple BP. Also i have an Actor#1 (The spawner) that spawns the meshes(Actor #2) right when the game runs in random locations. i Dont have already in-game meshes that i put before hand. The BP below is from the actor #2 (The meshes) thats responsible with randomizing the size and locations. While the Actor #1 (Spawner) spawns multiple Actor#2’s right when the game starts. So how do i go about making a scoring system. i checked out this video and tried it out however it wont work because the actor its trying to destroy for points in the score is already in game while mine gets spawned when the game starts.

The Video: score unreal engine - blueprint communication - YouTube

BP(Actor #2 Mesh):

BPs:

60481-bp.png

My Level world components:

60483-capture.png

It’s shown in an Epic Games Tutorial series. The one about the Endless Runner.

Here’s a link to it

It should be in the 4th video. Take a look at it and tell me if it helped you!

Ok will do

Sorry that doesn’t help.

I think the preferred way for you is to use the PlayerState for saving your scores.

It will also work, if you include Networking. (The PlayerState is replicated to each client.)

From the PlayerController you have direct access to your PlayerState.
You can get all PlayerStates from GetGameState->GetPlayerArray in Blueprint for example.

  • Just create a Blueprint which derives from PlayerState (help)
  • Add a public Counter variable
  • Increment it in the OnEndPlay Event of the actor or in the PlayerController for example
  • Your HUD can access the PlayerState through the Controller (GetOwningPlayerController)