How To Set Up A Two Weapon System - Unreal Engine 5 Tutorial

  Рет қаралды 14,929

Pitchfork Academy (MizzoFrizzo & Co.)

Pitchfork Academy (MizzoFrizzo & Co.)

Күн бұрын

Пікірлер: 96
@joxxix7035
@joxxix7035 9 ай бұрын
many thanks, Mr mizzo, I really appreciate how hard you have been working to upload the best way to do this code, as always you are awesome!!!
@ty_teynium
@ty_teynium 5 ай бұрын
I've been looking for this type of system for the longest! Thank you!
@aurustarsia5244
@aurustarsia5244 9 ай бұрын
I get tons of error logs: Accessed none trying to read class from: 1. Switch on Enum Weapon Class 2. Set current weapn int 3. attach component to componenr Would appreciate your help Mizzo, I followed your tutorial 1:1 and I also followed the physical weapn pickup tutorial. And additionally the weapons I am picking up are not attached to the sockets anymore. They are just not at the socket. Idk where they are
@PitchforkAcademy
@PitchforkAcademy 9 ай бұрын
It sounds like there's nothing stored in the index of the array you're trying to access. Did you add the two default indeces on the array?
@PitchforkAcademy
@PitchforkAcademy 9 ай бұрын
@7:13
@aurustarsia5244
@aurustarsia5244 9 ай бұрын
@@PitchforkAcademyThanks for the answer! Much appreciated. Yes, I set the indezies and set them both to none. Even tried to put a default selection of the Pistol in there. Thought this might fix something but it did not. So I changed it back to none. Then I thought I might missed something that you eventually explained in another tutorial. But that cannot be the case since I also watched the other "physics weapon pickup/spawn" tutorial. And that worked back then. So what could be wrong else?
@PitchforkAcademy
@PitchforkAcademy 9 ай бұрын
@@aurustarsia5244 I'm really not sure. I follow my own tutorials 1:1 and make sure that everything works as expected, so I don't know what to say other than you must have missed something. Either try some debugging methods or even start over (I did this many, many times when I was starting out).
@aurustarsia5244
@aurustarsia5244 9 ай бұрын
@@PitchforkAcademy Okay. So, if I follow this tutorial and the one with physics weapon spawn/pickup then it should work? Or is there something you add in another tutorial which is important for it to work?
@kimbalboa9398
@kimbalboa9398 8 ай бұрын
Another awesome tutorial, thanks mate! Learning lots ;)
@moosehead13
@moosehead13 2 ай бұрын
The fact that you reuploaded a video you had already done because you found an error/better way make you a champ in my heart. So tired of youtube tutorials where they mess something up and then spend 3 videos having to make workarounds/fixes instead of just doing what you did. I have one question for you. Have you given any thought to using Data Assets housed in a Skeletal Mesh Component? I have used your system of a master class housed in an Actor before, and was curious what you think is the most streamlined way to equip & manage a weapon system.
@PitchforkAcademy
@PitchforkAcademy 2 ай бұрын
@moosehead13 Hey thanks, that's really kind of you to say. I do try... Ummm I'm not 100% sure what you mean, but I do have this new weapons system video that may be of interest to you: kzbin.info/www/bejne/fpC0ZmqPqNRso68 🙂
@moosehead13
@moosehead13 2 ай бұрын
@@PitchforkAcademy Hey thanks for the reply! So rarely do creators actually respond to comments & questions. I checked the video you linked me and I see you are using a skeletal mesh component for your "BP_WeaponMaster" blueprint ,which is reassuring, but I was curious of the value in using Primary Data Assets to store all the properties of a weapon instead of putting them inside the skeletal mesh component blueprint. I am currently deep in AI systems following GameDevRaw's "Making an AI Guard" series (link below) and he went about using a PDA to create essentially a master data asset and then creating basically a child data asset of the PDA for each weapon he uses in the series. Other then having to go into the Project Settings>Asset Manager>"Primary Asset Types to Scan" and adding a new index for the PDA it seems like a much more efficient & streamlined system. I have never been the biggest fan of Data Tables as they seem to have issues when they get too big or when information is changed too often, but Data Assets seem to be a solution that feels a lot more stable. My question is centered around these new, to me, blueprint types and if you had any opinions or experiences using PDAs that could help me decide if they are worth using or if its better to just store all the properties of the weapon within the skeletal mesh component? Thanks again for your time & I look forward to checking out your series when I get into weapon systems! Link to GameDevRaw's video on "Weapons using Data Assets - Making an AI Guard #2 - Multiplayer AI - Unreal Engine 5 tutorial": kzbin.info/www/bejne/rqmsimOea5xjerMsi=pKKUg3NMT2hznykN Clip explaining Primary Data Assets: kzbin.infoUgkxKt_Dd3MGLEGMY11mbd3MPB92S-z1FBJd?si=p7sb2H-2JvCE9sgh
@d_Howard
@d_Howard 5 ай бұрын
I saw a nifty tutorial a couple years ago where the new weapon that was picked up was shown slung over the player's shoulder rather than just disappear into an inventory, or whatever. With a push of a button, the equipped weapon could be swapped out for the secondary. (Would be nice to have a pistol in a holster on the players belt, and maybe a knife, too!) Enemies don't stop attacking if you run out of ammo. You need a back-up! Don't want to be reduced to hand-to-hand...
@PitchforkAcademy
@PitchforkAcademy 5 ай бұрын
Actually I set up exactly that in my replicated weapons system tute (just not the animations): kzbin.info/www/bejne/qWfGeqeYp52tgpI 🙂
@d_Howard
@d_Howard 5 ай бұрын
@@PitchforkAcademy Nice! I'll have to check that out!
@jamaalsineke2405
@jamaalsineke2405 3 ай бұрын
Thank you for this excellent tutorial. QUESTION:How would you give weapons spell slots that you can drag and drop differnt activatble spells to? I'm prototyping a hack and slash with a two weapon system. Weapons have a basic attack and I want 3 additonal slots for flexible spells like Albion Online.
@PitchforkAcademy
@PitchforkAcademy 3 ай бұрын
I'd probably just store them inside your weapon BP as class references to your spell class.
@jamaalsineke2405
@jamaalsineke2405 3 ай бұрын
@@PitchforkAcademy THank you for your prompt respone I appreciate you taking the time to get back to me
@lz4090
@lz4090 9 ай бұрын
Hi. Whats the advantage of using a child actor for the equipped item vs directly attaching it to the mesh and socket.
@aurustarsia5244
@aurustarsia5244 9 ай бұрын
It worked so fine, really! I brought it to work for 3-4 weeks now. But today when I started unreal engine and just pick up the pistol and shoot, it will rotate to it's right. This is not happening with the other weapons. This bug just comes out of nothing.. any idea what the problem is?
@PitchforkAcademy
@PitchforkAcademy 9 ай бұрын
Have you got military weapons dark AND silver added to your project?
@aurustarsia5244
@aurustarsia5244 9 ай бұрын
@@PitchforkAcademy Yes. All worked fine perfectly. But today, out of literally nothing, the weapon (ONLY THE PISTOL) rotates to the right when I shoot.
@PitchforkAcademy
@PitchforkAcademy 9 ай бұрын
@@aurustarsia5244 It's probably playing the animation for the wrong pistol. Try changing that.
@aurustarsia5244
@aurustarsia5244 9 ай бұрын
@@PitchforkAcademy I cannot imagine this being the error since it always worked fine until now. But I highly appreciate your time and I will have a look on the pistol w animation tomorrow. Thanks
@aurustarsia5244
@aurustarsia5244 9 ай бұрын
@@PitchforkAcademy Quick update. Since all worked fine until yesterday, I deleted the pistol mesh, bp_pistol and bp_pistol_pickup and I did everything from start again. Creating the mesh, collisions etc. Still, this error occurs that the weapon is getting deformed and rotated to the right when I play the shoot animation. But as soon as I play the reload animation the pistol works fine again. Then, if I shoot, the rotation and displacement happens again. I am so confused since it worked at the beginning and the fact, that it is working for all the other weapons. I have no clue what's happening.
@korypeters2059
@korypeters2059 7 ай бұрын
nice cant wait to implement TY
@fearingalma1550
@fearingalma1550 4 ай бұрын
Did you decouple the Input Action in the character model compared to the previous, one gun version of this code? I set it up this way but I noticed the IA was just not there, and as such, I straight up couldn't pick up anything. Is it in another BP? For context, I came here from How to Create a Weapons System with Simulated Physics, so I haven't been following the FULL tutorial, and I was able to keep up with most of the small changes you made to some of the logic since you went over them (like the new namespaces to reference socket points on the model).
@fearingalma1550
@fearingalma1550 4 ай бұрын
No, that's not it. It's in the Pickup Master, the entire reason Spawn Weapon happens is off Event Interact. This is very odd.
@fearingalma1550
@fearingalma1550 4 ай бұрын
...well it might be my attach points, I checked my model in decoupled camera and it was sticking out my torso. But it still wasn't firing...
@fearingalma1550
@fearingalma1550 4 ай бұрын
...it was because I swapped the body and attach point inputs. WHOOPS.
@Silvieson
@Silvieson 2 ай бұрын
! Solved it by changing the Not equals to Equals to.! Im not entire sure where i am going wrong, Everything is working but spawning drop. did it exactly like yours but it always hits the false = SAME WEAPON.. am i missing where we populate the weapon to spawn var on the spawn weapon event? followed the previous tut and it was working fine. change it to the new system and it no longer drops. I added it as an input and it is a class reference to the BP_WeaponMaster. This has got me scratching my head.
@6henny443
@6henny443 4 ай бұрын
for me my index 0 is knife, as the player always has a knife, this setup works but the knife stays attached when swapping other weapons. any ideas? I really appreciate the help. I imagine bc knife its it's own class, what if I make the knife a primary. But also the palyer should never be able to drop knife
@DylanPlayzz871
@DylanPlayzz871 5 ай бұрын
I’m going to go back through and try this again. But somewhere I went wrong. When we do our first test and it works for you it don’t for me. Something with my socket or something. And the names are all spelled correctly. My gun spawns in my players legs or a random area. It’s different for both guns (I only have the AR and pistol) And I no longer have up and down movement for my guns just sideways. So looking left and right my guns move where ever they are floating but when I look up and down they just stay stationary
@ayititobahtiar2967
@ayititobahtiar2967 4 ай бұрын
Why does the transition from being unarmed to picking up a weapon go straight to aiming? Is there no idle holding weapon animation?
@PitchforkAcademy
@PitchforkAcademy 4 ай бұрын
It's the first state in the state machine. If you want to animate things, you have to animate things... 🙂
@ayititobahtiar2967
@ayititobahtiar2967 4 ай бұрын
@@PitchforkAcademy okay, thanks for all tutorial you've made, its help full
@hashimshah7732
@hashimshah7732 8 ай бұрын
can you please make a video on how to make camera ignore character mesh so that it wont clipped through the character when character is getting too close to the camera
@UInrealZTurtroials-vq3xe
@UInrealZTurtroials-vq3xe 4 ай бұрын
go to project settings>search for Near Clip Plane and change value low to something like 1 or .1 then restart project
@DefaltThunder
@DefaltThunder 3 ай бұрын
Hi , is there a way to attach the weapon "disappearing" to the belt or in the back? I dont understand where the weapon unequipped goes... it just destroy?
@PitchforkAcademy
@PitchforkAcademy 3 ай бұрын
@DefaltThunder I'd recommend my new video instead: kzbin.info/www/bejne/fpC0ZmqPqNRso68 In this one we set them to be invisible, but you could just as easily set them to attach to a holster socket...
@DevilClutches
@DevilClutches 9 ай бұрын
NIce tutorial!
@emilweinbergjensen3565
@emilweinbergjensen3565 9 ай бұрын
I made it and it works fine but my weapons are not scaled properly I don’t know why
@zonerda
@zonerda 9 ай бұрын
I added a drop system to this but it only drops the one specific weapon so what would be wrong in there 😂 i have checked the weapons blueprints multiple times and dont find the answer. The print string what we made there says same weapon when try to drop other weapon. Works good with that one weapon.
@PitchforkAcademy
@PitchforkAcademy 9 ай бұрын
I'll throw together a drop weapon video after work today (in about 12 hours). ✌️
@zonerda
@zonerda 9 ай бұрын
@@PitchforkAcademy awesome 👍 you are the best
@spikef1114
@spikef1114 7 ай бұрын
Remember to set the value of the "current weapons class ref" array to nothing or else you'll have the items in your inventory
@PitchforkAcademy
@PitchforkAcademy 7 ай бұрын
In what scenario?
@6henny443
@6henny443 4 ай бұрын
7:55 if you did want to say start with a knife, i tried to set array 0 to my knife bp and it equips to the players index but you must use the input to equip it, it does not spawn in hand on play start.
@PitchforkAcademy
@PitchforkAcademy 4 ай бұрын
Copy the equip logic and slap it on Event Begin Play. 😉
@6henny443
@6henny443 4 ай бұрын
@@PitchforkAcademy could you help me from what node to what node i need to bring to event begin play? I would think from spawn actor to attach component to component, but idk where to get transform from and If i use get actor transform it stil does not attach to the socket at the start
@PitchforkAcademy
@PitchforkAcademy 4 ай бұрын
@6henny443 Sorry mate no, I don't have the time to help everybody in that way. There are countless forums on facebook and reddit for example where anybody can easily find help, or you could join my discord where there are several very generous people who can help. I literally just finished work and it's midnight here, soooo... goodnight! ✌️
@protophase
@protophase 6 ай бұрын
Why do I have two meshes on my BP_FirstpersonCharacter? One is named FirstPersonMesh and contains the arms the second one is named just mesh(CharacterMesh0) and doesn't contain anything
@PitchforkAcademy
@PitchforkAcademy 6 ай бұрын
Probably because Mesh is inherited from the Character class and because they need to parent the First Person Mesh to the camera they've just added another skeletal mesh component.
@spiritdragon6224
@spiritdragon6224 9 ай бұрын
when i pickup a weapon the currently held weapon is put on the ground instead of the players back
@PitchforkAcademy
@PitchforkAcademy 9 ай бұрын
Are they both primary or both secondary?
@spiritdragon6224
@spiritdragon6224 9 ай бұрын
It looks like this is caused by both weapons being set as primary, do you know how to make it so if you only have a primary in your hand you can pick up another primary
@PitchforkAcademy
@PitchforkAcademy 9 ай бұрын
@spiritdragon6224 This set up is to carry one primary and one secondary. A set up that allows any weapon in any slot is going to be different.
@spiritdragon6224
@spiritdragon6224 9 ай бұрын
at the beginning of the tutorial you pickup two primary's, in my version which followed the tutorial you cant do that @@PitchforkAcademy
@PitchforkAcademy
@PitchforkAcademy 9 ай бұрын
@spiritdragon6224 No I don't. Look again.
@BlonkyWasTaken
@BlonkyWasTaken 8 ай бұрын
What is the spawn weapon thing at 6:09 on the pickup master bp
@BlonkyWasTaken
@BlonkyWasTaken 8 ай бұрын
andh ho do I get the custom event Spawn weapon
@PitchforkAcademy
@PitchforkAcademy 8 ай бұрын
As I said at the start of the video, this is built on top of my weapons system with simulated physics. You need to follow that tutorial first: kzbin.info/www/bejne/g4qxd5lnbNqdmNE
@sisqobmx
@sisqobmx 6 ай бұрын
Is this replicated?
@PitchforkAcademy
@PitchforkAcademy 6 ай бұрын
No, but I do have a replicated weapons system that is more streamlined than this! kzbin.info/www/bejne/qWfGeqeYp52tgpI
@TheFuri0uswc
@TheFuri0uswc 9 ай бұрын
It just deletes the weapon i pick up and i don't take it.
@PitchforkAcademy
@PitchforkAcademy 9 ай бұрын
You must have missed a step or two. I suggest having another go. ✌️
@TheFuri0uswc
@TheFuri0uswc 9 ай бұрын
@@PitchforkAcademy i checked id it it's identical to the video
@TheFuri0uswc
@TheFuri0uswc 9 ай бұрын
@@PitchforkAcademy nym im dumb it was invisiable
@aurustarsia5244
@aurustarsia5244 9 ай бұрын
I have the same error. I will try to fix it this evening. If it worked imma post it here as reply then you can try the fix as well. Meanwhile you may re-watch the video as we might really missed out something
@TheFuri0uswc
@TheFuri0uswc 9 ай бұрын
@@PitchforkAcademy Not it;s deleting the second weapon I picked up
@pwnonator
@pwnonator 6 ай бұрын
do u have a discord?
@PitchforkAcademy
@PitchforkAcademy 6 ай бұрын
Nope. I don't have the time to create and manage one.
How To Set Up An Advanced Ammo Inventory - Unreal Engine 5 Tutorial
1:20:16
Pitchfork Academy (MizzoFrizzo & Co.)
Рет қаралды 7 М.
How To Set Up A Replicated Weapons System For Multiplayer - Unreal Engine 5 Tutorial
2:06:15
Pitchfork Academy (MizzoFrizzo & Co.)
Рет қаралды 10 М.
Из какого города смотришь? 😃
00:34
МЯТНАЯ ФАНТА
Рет қаралды 1,2 МЛН
Elza love to eat chiken🍗⚡ #dog #pets
00:17
ElzaDog
Рет қаралды 25 МЛН
This dad wins Halloween! 🎃💀
01:00
Justin Flom
Рет қаралды 69 МЛН
Weapon Switching In Unreal Engine
14:01
The Game Dev Cave
Рет қаралды 3 М.
How To Blend Animations For Different Weapons - Unreal Engine 5 Tutorial
14:00
Pitchfork Academy (MizzoFrizzo & Co.)
Рет қаралды 13 М.
How To Create A Weapons System (2.0) - Unreal Engine 5 Tutorial
2:15:19
Pitchfork Academy (MizzoFrizzo & Co.)
Рет қаралды 28 М.
Epic's Unreal Optimization Disaster | Why Nanite Tanks Performance!
13:07
Threat Interactive
Рет қаралды 233 М.
The Most Common Mistake Beginners Make in Unreal Engine | UE5
12:17
Ali Elzoheiry
Рет қаралды 122 М.
Using Data Asset for Weapons
38:24
Patsanoob
Рет қаралды 6 М.
Weapons In Video Games (This is How it's Done!)
6:36
MoBassem
Рет қаралды 51 М.
How To Set Up Semi-Auto, Full-Auto, and Burst Fire Modes - Unreal Engine 5 Tutorial
25:38
Pitchfork Academy (MizzoFrizzo & Co.)
Рет қаралды 7 М.
I solved Unreal Engine's Package Size Problem...
14:35
Cobra Code
Рет қаралды 80 М.
How To Create A Weapons System With Simulated Physics Pickups - Unreal Engine 5 Tutorial
51:15
Pitchfork Academy (MizzoFrizzo & Co.)
Рет қаралды 105 М.