← Learn library

Unreal Engine & Blueprints

Collectibles Part 2

Channel: CGI Nerd Unreal Engine ·

Written guide

Original CGI Nerd Unreal Engine video thumbnail
Collectibles Part 2CGI Nerd Unreal Engine · Video hosted on YouTube

Playing loads YouTube content. YouTube processes data after activation.

Watch on YouTube

If the player is blocked or unavailable, use Watch on YouTube.

Software: Unreal Engine

Part 1 creates coins that disappear on overlap. This lesson adds a count on the side-scroller character so the collected value can remain after each individual coin Actor is removed.

The exact Unreal Engine release is unidentified. The result is an Integer variable on the current character, not a saved inventory that survives character destruction or a new play session.

Put the count on the object that remains

At 00:02–01:00, the instructor chooses the character Blueprint as the location for the coin counter. The reasoning is tied to lifetime: individual pickups disappear, while the character remains available to collect additional coins.

Open SideScrollerCharacter rather than placing the total on each Coin instance. Otherwise, separate pickups would own separate values instead of contributing to the demonstrated shared character count.

This lifetime assumption is limited to the current character. The lesson does not demonstrate transferring the value to another character, a save file, or a persistent game instance.

Check the overlapping Actor and increment the stored value

During 01:00–02:01, Actor Begin Overlap leads into Cast to Coin, with the overlapping object supplying the candidate reference. A Coins variable is created as an Integer and compiled with its default value of zero.

The successful coin path reads Coins, adds one, and stores the result back into Coins. The assignment is necessary: an addition node computes a value, while Set Coins updates the character’s stored state.

The cast distinguishes the intended pickup class from other overlapping actors in this example. It does not create a coin, and the counter should not be connected so that unrelated or failed casts also increment it.

At 02:01–03:42, Print String displays the stored count after the increment. The play test shows the number increasing as the character reaches successive coins.

Verify the removal and counting behaviors separately: the Coin Actor still handles its own disappearance from Part 1, while the character now records the count. A missing coin is not proof that the character’s variable was incremented, and a debug message should show the updated stored value rather than an unrelated constant.

The recording does not demonstrate a one-award-per-instance guard, persistence, or handling for several overlap notifications from the same pickup. It establishes the basic character-held count in the tested scene. Part 3 adds feedback effects, while Part 4 adds a separately counted ring type.