I’m working on my first weapon BP. I have been reading whatever I could get my hands on, trying to figure out the best, Newb friendly way to go about this. I opted to go with a Gun Parent. From that I created two Children which have different fire rates and ammo counts. Nothing too crazy. But then I wanted to add in a Line Trace as I plan to make a Laser at some point. From what I understand I’m supposed to add the Line Tracer into my Parent BP. Is that correct?
I attached a few photos. “Default Projectile” was my base projectile across my weapons. I then went and created the Line Tracer in the Gun_Parent BP right above it. But then I hit a wall. I have two separate weapon systems at this point a Projectile and a Line. How do I choose which which to fire and when? As of right now I have to take the Fire Bullet and either attach it to one or the other. How do I configure this BP so that I can fire either one? I was thinking of using a Branch to connect them but it always calls to the Trace. I hope I’m making sense. If not I apologize in advance and thank you for your help!
Hiya, did you solve this? If not: yeah you could use a branch, but better yet: setup an enum called something like firetype, guntype or … List all the firing types you want. Then use the enum to switch between linetrace or projectile. Include it in your base weap BP. Then use switch on E_“firetype” to make you weap fire off what you like. Set the “firetype” enum on the weapon whenever you change ammo or however you want. I have attached a real quick slap together just to give an idea. You can have as many different firetypes or Modes (single, burst, continous) as you like using the same method.
I’m a bit stuck with getting my ammo from the Gun_Parent to the Ammo_Blue Print. This is what I have so far. I can’t connect the Target to the player character. I believe it’s because I should be casting to the Gun_Parent since that’s what’s holding my ammo variables. I just can’t get it to work. Also, this approach (if I did get it to work) would only offer one type of ammo? I have to figure out how to implement a weaponType variable into my Gun_Parent so that I can call it within the various Children? I don’t know
I’m still going through your project. I really cannot thank you enough for doing that.
My game’s setup like Quake! No reloads. Just pew, pew until you’re out of ammo. So I have a simple ammoCurrent and ammoMax.