Download

First Person Weapon Blueprint Help

Ok so I’ve been working on fps’s in UE4 for a very long time and for some reason I could never figure out how to get the weapons to actually work… I see fps tutorials everywhere that tell me how but the thing is there always the exact opposite of what I wanted. to get to the point I have a horror game where the player can pick up and drop any item/weapon they want from an 8 slot inventory. I have the inventory and the weapon pickup working, just not the weapon appearing in the viewport and weapon use. So I have an idea to use actor blueprints that will be spawned in the player viewport when equipped so I can easily make multiple actor blueprints for different weapons. I did figure out how to make the blueprint actors spawn the weapon static in the viewport by calling an event to fire when the weapon was selected, but input on the actor never worked as I couldn’t figure out how to make input work on it. Would switching out Actors for pawns be easier and allow for weapon input. I have tried using pawns but I can’t figure out how to make them spawn. I did have code set up to spawn the actor blueprints but I broke it when I disabled it and tried using pawns :confused: I will try and fix it but I just really need to know how to enable input on actor blueprints that have been attached to the player blueprint or another easier weapon system method using my inventory system which I can explain what it is and how it works if needed (oh and how the weapons work as well). It would really help out a lot if someone knew how to accomplish this as FPS weapons are not exactly my friends when it comes to UE4.

What are you asking exactly ?

Simply to know if I can enable input on an actor blueprint that was attacthed to a player blueprint so a player can use the code in the blueprint to use the weapon without filling up the player blueprint with weapon codes. ex shooting, reloading, aiming via iron sights ect.

(Ps i did use the enable input node but it still wouldn’t let me use the gun.)

Player Input action -> Weapon Class Event

Firing a weapon is typically all coded in the weapon class. The input action (in pawn) calls an event in the weapon class. Said event processes the logic.

e.g.

Pawn class, Input action Fire

Weapon Class, Fire Weapon Event

Weapon class, firing mode logic

Each of these firing mode events call “Fire Weapon Sequence function”. This function spawns the projectile, handles recoil, animation (montage), sound fx, muzzle flash, ammo deduction etc.

Thank You So Much for this! I’m gonna try this out and see how it goes! I’ll be sure to ask more questions if something does come up! Thanks!