So I’d need to create more variables in the player? The only reason I can get the ammo currently for one is that the child holds all the ammo and it would be a pain if I need to creat more ammo types on the player character
As for the widget they are all the same instance so that the styling remains the same
Does it make sense? Essentially, each widget gets a reference to one weapon. The widget does not care what current is, it polls data off the ref we fed it.
I understand most of what’s going on. My current setup is very bad I know, yours is much more efficient, see if you can make any sense of what Ive done so far
This is the gun spawning logic
The weapon wheel widget is created on the W_PlayerHUD. I’n not sure if all those nodes plugged in like that is neccessary.
Sorry to bring this up again but in terms of storing and saving things like AmmoCurrent, ClipSize, Recoil, Stability and damage per weapon would this be better if I migrate it to the player?
The only way I can think of doing it is to have them all there but this would increase the list by 5 times if I had AmmoCurrent for Pistol, Shotgun, Rifle, Sniper, RPG, ClipSize for Pistol, Shotgun, Rifle, Sniper,RPG etc all on the player. As you can see here in my Gun_Parent the list is long.
I’ve done a few tests with the AmmoType and it works as expected. Here you can see that I decrement the ammo stored in the player, this also allows me to update the weapon widget easier, but maybe less efficient??
Nah, it goes into weapon actor. You give each widget access to the weapon (I personally wouldn’t and drive it with events, but get it to work as is for now).
how do I plug in the target here?
The widget has a weapon variable, we set its value to the weapon we need.
We tell a widget which weapon actor to communicate with.
Normally, you’d have the weapon create a widget and add it to the player’s HUD, that’d would avoid any mess. The widget belongs to the weapon after all, the hud just shows it. But it depends on how it all works. If you only have 3 weapons in the game and the player does not pick up anything new, you might as well create it all upfront, as you did.
thankyou for your detailed response, I’ll continue with what I have then. Currently when I select a weapon it spawns them all , I now think it’s due to each weapon selection being derived from one widget so I’ll look for a way to fix that