Weapons and cast to nodes not working the way i want

So, i have been trying to code in a highly functional weapon system for my character. After a long while i finally managed to get weapons able to be picked up and visually represented on the character. The system i need is for the character to pick up any weapon and have lots of different stats. and a multitude of different weapons (possibly hundreds)

Therefore it cannot all be coded in the character. I need to get variables from the weapon. I tried coding the weapon separately, but still came up with horrendous blocks to get it working :frowning:

I am now running into the problem where a cast to node works only for a short period of time and it after PIE it throws out some error and i can’t seem to figure out how to fix it. It’s been annoying me for days now so as i can’t seem to figure out what i am doing wrong or missing, some help would be appreciated.

Here is my character set up.

character collison is set to pawn

The weapon attachment code. collision is set to overlap only pawn

Cast is not varable, you need varable to keep your weapon also check if you overlap with weapon or e.se you gonna do calls on None

Also why you not placing weapon in seperate classes? When you tried ig, did you tried using funtions? Because thats what you should use

“When you tried ig, did you tried using funtions? Because thats what you should use”

Yes, i had functions for a multitude of things, the trouble arised when i had to call back to the player and there wasn’t anything i could use without errors throwing up left right and center, or simply not the option to when i wanted to draw things back to the hud. Putting the code to the character resolved 90% of my problems.

I’m casting to my weapon because there is a variable there that has my max ammo variable. that is what it is calling.
The code even works in game just fine, for about a minute and then nothing seems to be called, I’ve fiddled around with all the actor overlaps and can’t get it to work.

“Cast is not varable, you need varable to keep your weapon also check if you overlap with weapon or e.se you gonna do calls on None”
Do you have some example blueprints? I don’t tend to learn very efficiently from text. I only get as far as i do because i like problem solving and seeing things work.

Just hold in varable actor thrown on begin overlap and then set to none on end overlap. Cast is not varable so it wont hold actor from that event, sonyou need something for hold