I’ve just started working on my game, and I’m new to both Unreal and C++, but I am a programmer.
I’m wondering how I should design a weapon system…
In other words, how can I have a “weapon class” that allows a “gun” or a “sword” to attach to a player or npc. This would allow each individual weapon to be developed completely separate from the player/npc. In other words, I don’t wanna hard-code weapons into the player or npc.
In other words, a “gun” component thing would hold:
-A gun mesh
-Particles for muzzle
-Takes control of events, and interacts with the player’s functions
-Holds specific animations for the player to do. Probably by simply overriding the default animations as governed by the animation code?
-Have a special position, cause a gun or a dagger are different shapes and are rotated and positioned differently
I’m assuming it would fit into a socket of the player…
I’m not sure how to have an object that connects the player via blueprint, and therefor overrides stuff on the player. I’m not asking how to do these individual things, I’m wondering what system to use that allows me to do these things. Would I simply make a weapon class and go on from there? But what would the weapon class be based on?
This system would be used for a lot of stuff, like armor and such.