Ok, so What I want to do is get an ammo counter working for my HUD, but it needs to work from C++ meaning I have code in place that I want to use in blueprints to make the counter.
this is the code block I want to reference for the count, Obviously the Ammo part of this.
I think it needs reference to the Gun that the Player Character is holding at the time of instantiation…But I don’t know how to point it to that particular weapon?
Hello! Where are your Player equip logic? In C++ or in BP? The most often solution for such things are events and delegates. At the moment when you Player change weapon he/she raise an event/broadcast delegate with some info - what weapon is equipped now, for example. UI widgets (or even HUD!) subscribe to this event/delegate and just fire some logic on it.
So the player spawns with the rifle in question as the default weapon. And yes this is done in C++ and I have BP class based on said C++ classes. As it stands when I cast to my BP_ MainCharacter There is no “Gun” class to come off of As BP MainCharacter pin This is where I have the issue.