When I play with more than 1 player or in a dedicated server my editor crashes. The crash happens due to a function that gets called in PostInitializeComponents(). In it I’m calling a function called ‘InitialiseWeaponInventory()’ which would spawn a weapon inventory actor, which would attach itself to the player and would than spawn a couple of weapons. When I play in a server or with multiple players, my game crashes after the 1st tick happened with this in the logs:
Any idea how I can fix this?
Screenshots of the CPP file: