I’m going to implement a Base Class for the Weapons in my game in order to define all the shared characteristics between them (Damage, WeaponName, FireRate…)
I made this one:
And in the FirstPersonCharacter.h I declare a CurrentWeapon (which indicates the active weapon, the one the player is currently holding) amd a TArray of Weapons in order to make an **Inventory of Weapons **that the Player picks up
As you saw in the Weapon.h, the Constructor takes some arguments and then assigns them to the “internal” variables.
So I want the FirstPersonCharacter to have, when he spawns the first time, kind of “Default Weapon”.
So in his constructor i write:
When I compile, the Unreal Engine crashes
I think it has problems when I call the Constructor of the AWeapon class.
In “pure” C++ that’s absolutely lawful, but I don’t understand which is Unreal Engine’s problem…