Adding SceneComponents in constructor, something going wrong

You need to add the UPROPERTY keyword to subobjects such as components, or the engine’s management internals will ignore it and blueprints will not be saved with said subobjects. This is what’s happening here – the initial construction goes fine, but when you save your level, the components are lost, leading to these errors when the level is subsequently loaded.



	UPROPERTY()
	USceneComponent *	ActiveGroup;
	UPROPERTY()
	USceneComponent *	InactiveGroup;
	UPROPERTY()
	USceneComponent *	LootLocations;


That’s just the very basics. There is a lot you can do with managed properties in the editor, like making them editable so these components don’t always have the same locations. This is done through the VisibleInstanceOnly/VisibleAnywhere/EditInstanceOnly/EditAnywhere property keywords. I won’t go into too much detail as this is just touching the tip of the iceberg and there are lots of examples and tutorials out there to delve in.