Hi!
No worries about the autism, you are in good company i would say ![]()
Now on to the questions, the “How its done” simply does not exist.
There are many way’s this is done. Ofcourse its generally a hitscan vs object
type of model. But so many different ways to implement.
One thing to consider is that if you want a more realistic firing of bullets you always have to take the physics in to account. Not just the physics of how bullets work but the actual physics of the engine itself. When you fire a physics object at high speed at close range you sometimes get very unpredictable behaviour with the bullet just going through the object instead of colliding.
I watched a gdc talk from i believe the insurgency guy’s(that also use unreal)
That had a mixed system, they use a hitscan bullet for the close range to prevent physics glitching, and after some amount of meter’s that would spawn the actual physics object for longer range travel.
Anyway, if i would set something like this up i would split each part into its own function/bp.
The player has the ability to pickup the items,weapons and press the reload/fire/change fire “commands” that get’s called on the weapon they have equipped. Then each weapon itself has its own contained function that control’s its own behaviour like ammo type/count spread etc.
Then each ammotype has its own stats that give it its velocity/penetration/damage etc. So it would be a player->weapon->bullet order of events.
So when player has a weapon equipped he can press the fire button, then the weapon would get the call to fire, but check’s if it has ammo. if not then it would simply click empty. I think in this way you have a general setup for weapons and would allow you to make many different types of weapons and ammo independent of the other systems.
Hope this helped in some way ![]()
1 Like