I read several Tutorials about Weapons and how to add the basic funcionality but at some points the tutorials are inaccurate or won’t work.
So i mixed up some tutorials to make my own way to implement weapons but there is currently a big problem.
In the Armes Mesh I added a Socket for my weapon, added a preview mesh and everything looks great.
How or from where do you get the weapon mesh? -> because in the static mesh you have to set the mode to “moveable”. Otherwise it wont work! So for example: when you add the weapon mesh to the component tab you can change the mode and after that you can attach it to the socket.
So you could create a new blueprint with the weapon mesh in it and in there you can change the mode + after that you can spawn it in your other bp
The mesh comes from the content browser. I also tried to use a skeletal mesh but nothing happens. I also tried to your tutorial about attatching stuff to a socket. It also won’t work.
Somtimes - not every test play - i reciev 1 error while playing. Seams like the socket is missing sometimes. This is very strange.
Have you done it exactly the same? (so with the level blueprint) -> when not, then try it out, because then we will see if it is a problem with the socket or your upper setup
I’ ve done it exatcly the same.
This is the Tutorial i was reading and trieing to recreate: ://creategamesfromscratch.blogspot.de/2014/05/prototype-adding-hands-and-weapon.html
He is just using a static mesh from the content browser. SkeletalMesh also won’t work. I’m not recieving an error with this but the gun isn’t visible.
Do you have any way of checking if the thing even spawned? Your setup isn’t exactly ideal to be honest. It’s not a prime example of oop. But it’s not your fault, since you just followed a tutorial.
You call “SetStaticMesh” on your weapon and then you attach it, but the question is, what is that weapon variable and when do you actually spawn the weapon?
I would rather spawn a new weapon (or unhide a previously spawned one) and then attach it to the socket.
Hey,
sorry for the late reply. I’m now working with another weapon system. I’m using weapon meshes that includes the arms - like the blue placeholder and just set the ‘1pMesh’ to my new weapon.
Changing some variables for recoil, Ammo and so on and everything is working fine. A lot easier than the tutorial. Maybe not the best solution for everyone but it’s working fine for me.
When I’m ready with my sytem and it’s working perfekt I’m making a short tutorial.