I was wondering if anyone could make a detail explanation on creating weapons. I could use a explanation on how to make a handgun, shotgun, and assault rifle type of weapons.
There really isn’t just a standard way for making weapons. You have to make pretty much all systems associated with it. The best i can offer is another post on the same topic:
As RimmyD said you will have to think about what you need and how you want to solve it.
There are two basic ways to handle a weapon. Either you spawn a projectile which then flies and has it’s own logic or you simply do a trace which will instantly “hit” the enemy and you can apply some damage or whatever.
The difference between weapons is also completely left to you. It can be purely visual. If you want a real shotgun you need to spawn multiple projectiles each dealing a bit of damage and spraying away in quite a wide spread area (which is mainly a modified rotation when you spawn them). You can control the gravity which affects the projectiles and all that stuff.
For weapons itself you have to think about how it should shoot. The speed, ammunition how fast the reload is (linked to an animation?) should it start to spray once you shot a bit? Should simply the character have a recoil applied but the bullets hit spot on? Are there multiple fire modi? How do you want to communicate with your weapon? Send an interface event from your character / controller? Or should it handle inputs itself?
A very basic weapon is included in the first person example. Besides that it’s really hard to help you with such a wide question. If you have more specific questions I’m sure we can help you. But there really isn’t a specific way to make weapons. It always depends on your use case and what the weapon should accomplish.
Yeah this may be better handled in the forums as it can be more of a discussion. The answerhub is more of a problem/solution sort of gig.
That being said, you could sit down and come up with what you want and list out some steps, get started and come back here with more specific questions to go along the way.
Why is guns the only kind of weapon? NOWHERE on Google can you find any tutorial relating to swords, etc.