Help with Coin Pickups

Hi, I am a first time poster and recently just started working on an experimental side-scrolling platformer project that I’m hoping to eventually develop into a full-fledged game. As a part of my project, I’ve been trying to implement coin pickups (called Star Gems in my game), but I have run into some issues while attempting to do so.

The first issue that I’ve been having is that for some reason while attempting to set up the coin pickups in the Blueprint editor, I’ve been unable to call up a reference to the coin/StarGems variable setup within in the SideScrollerCharacter Blueprint. As a result of this problem, the game doesn’t keep track of the total amount of accumulated coins/Star Gems like it is suppose to.

The second problem I’m having is that when I try to pickup the “coins” by jumping from underneath them, my player character will instead hit its head as if it were hitting a solid ceiling. I’ve also noticed that the player controller will also have some slight issues with jumping on the currency from above, with the character very briefly sliding off the currency before picking it up. And yet, there are no issues with grabbing the coins/Star Gems from the left/right sides, so once again I’m not sure what it is causing this issue.

I hope the above information, along with the screenshots included below is enough to provide sufficient context for anyone willing offer some insight into these two problems.

Any help in this matter would be greatly appreciated.

**EDIT: **I uploaded my project unto Git Hub & added a link to it:

Project Screenshots:

I tried adding the Event ActorBeginOverlap component into the coin pickup blueprint and it has improved performance, but there are still some issues. The player character can now grab the coin pickups from beneath but the player character will still act as it their hitting their head on a solid object while grabbing the coin pickup. This is problematic as it is going to interfere with platforming if the player character is constantly having their jumping interrupted by touching a coin pickup from underneath. There’s also still a tiny issue with the player character grabbing coin pickups from above, as the player character will have a small “bounce” off the coin pickup when they touch it.

I’m not entirely sure what is causing the issue, I’d guess it’s related to the Star Gem object’s collision, which has me wondering if perhaps the problem stems from the fact that the Star Gem object is an original creation I made in Blender. The reason I wonder this is because when I imported the mesh into Unreal Engine, it ended up with some sort of error that gives the object a staticky appearance as shown in the screenshot on the far right above. I was eventually going to get around to fixing that error but decided to leave it for the time being, but the error makes me wonder if perhaps the collision detection was also messed up in the process. Unfortunately, I don’t know because I’m still new to all of this, so I have no idea if the problem is the result of the blueprint not being setup properly, or if something is wrong with the setup of the collision box, or its some sort of problem relating to how the object was constructed and imported into Unreal Engine.

As for the other issue of the Star Gem variable, I set the variable in the SideScrollCharacter_BP to be editable as you suggested, but I still can’t a reference to the variable within the coin pickup blueprint. For whatever reason, I am unable to refer to a variable from one blueprint to another, and I don’t know how you change it so that you can.

I tried as you suggested and unchecked Context Sensitive, which did bring up the Star Gem variable. However, when I then tried plugging Get Star Gem into the Blueprint and compiling it, I got the following error messages:

  • This blueprint (itself) is not a SideScrollerCharacter_C, there ‘Target’ must have a connection.
  • Variable node Get StarGems uses an invalid target, it may depend on a node that is not connected to the execution chain, and got purged.

Assuming that I’m reading the error message correctly, the source of the problem would appear to be originating from a variable from doesn’t exist. The problem with this though, is that there is a Star Gem variable located in the SideScrollCharacter Blueprint, but for some reason the variable cannot be called into the coin pickup blueprint. The only way, seemingly, to call the Star Gem variable into the coin pickup blueprint, is to dragging the node connector from the Cast To SideScrollCharacter component. If I try to right-click and search for the Set Star Gem option in the list of Blueprint actions, I am unable to find it. I have noticed though, that in the coin pickup blueprint is a Set Star Gem component, but the variable in the SideScrollCharacter is named StarGem. Shouldn’t the Set Variable component displaying the name without the space?

The only thing I can think of that is causing this mess, originates from the fact this is my second attempt at trying make a coin pickup blueprint. The first attempt wasn’t going as I wanted it to, so I deleted the blueprint and decided start allover again. I’d guess that the program is somehow attempting to reference the old material despite the fact that I cannot find any apparent vestigial elements in either the SideScrollCharacter_BP or the coin pickup Blueprint. I’m not sure if it’s related, but I’ve been unable to delete any old folders, after I’ve moved the contents into another folder. Every time I try to delete the old, unused folder I get a message that reads “Failed to load assets”.

At this point, I feel like I’m just spitballing, rather than getting to the actual root of the problem. I’m honestly considering just starting a new project in Unreal Engine and rebuilding the blueprints from scratch, although there’s no guarantee that the same problem won’t crop up again.

As for my other problem, I tried replacing the Star Gem mesh with a cube and seeing what happened. Unfortunately, it didn’t help out much because the cube mesh’s collision appeared to override the blueprint, and ended up essentially with a solid, rotating platform doesn’t help in figuring out the problem with the Star Gem’s collision.