yesterday i have bought the Military Weapons pack for my FPS Game. I have added them to my game and can copy/past them to the ground where they are lying around. But what do i have to do exactly to use them? I am talking about picking them up and wearing one of them on respawn. I took a look at some YT-Videos and some Forum postings, but nothing helped.
What do i have to do to make things work, please?
Are those weapons skeletal meshes or normal meshes? -> dont have them ^^ After I know that I can explain it to you
Ok, here we go (static mesh way -> works nearly the same as the one with skeletal meshes):
- use the fps template + a modified version with your own arms or without the blue weapon
- Now we have to create some sockets. Open the skeletal mesh (arms) and add a “weapon” socket to the hands or any other place where the weapon should be attached. After that open the static mesh and also create a socket called muzzle
- create an actor bp and add the projectile properties:
- now create another actor blueprint for the weapon:
In the component tab you have to add your weapon mesh and a volume
Now we have to attach it to the character -> get an overlap event from the volume + create a bool variable which will “tell” us when the player is holding the weapon + do this:
Now we have to spawn our projectile from the mesh socket position:
Last but not least enable the input so that we can use the left mouse button (or any other input)
Ok, those are the basics steps. Now when you walk over the weapon it will get attached to the character + it will activate the bool so that we can shoot. Unfortunately I had not much time -> that’s why I havent added a description to the images, but when you have any questions, post them into this thread.
Now after you have done this steps we can go over to some other stuff like muzzleflash, sound, damage,… but that’s another topic
Hello and thank you for your explanation and pictures.
For step 1 and part 1 of step 2 i was watching this YT Tutorial ( Unreal Engine 4 Tutorial:Attaching a weapon or object to hand or socket - YouTube ), but got into some trouble with collision. How/Where do i disable collision?
Sadly i am not able to follow your steps from this point of step 2 on: “…After that open the static mesh and also create a socket called muzzle”. How exactly do i have to do that?!
You can disable the collision in the component tab - click onto the static mesh - go to collision - set it to “no collision”
Would it help you when I record a video? (unfortunatel with no sound -> atm I have some micro problems ^^)
Did you mean this section?
If yes, that didnt solve my movement problem.
Yes, a YT Video (even without voice) should be a big help!
Yep this section, but which kind of problems do you have with your collision?
Ok, just keep an eye on this thread, I will post the video in the next hours (currently working on my slow laptop :P)
Mabe i did sth wrong, thats why i got problems with collision. So best thing would be if you could show me all steps, please.
Here we go It should explain everything to you
(you probably have to rotate some sockets so that the projectile gets spawned right)
Unfortunately i´m not able to follow your steps from 0:33 on, because in my Game\Bluescripts folder there is no “weapon_mesh” data. I only got “My Character”, “MyHUD”, “MyProjectile”.
Here is 1 Picture from the mesh folder that came with the MilitaryWeaponPack:
That will be your weapon mesh/skeletal mesh -> in my case I renamed the mesh to “weapon_mesh” -> names that are shown in the video can vary a little bit
Where do i get my mesh from? What kind of do i need?
It should be in the package that you bought -> you need a static mesh (you could also do it with a skeletal mesh)
So instead of using a cube (as I did in the video) you have to use one of your weapon static meshes…
Thank you for your post!! thats help me a lot!