I’ve made an inventory system, which keeps model paths inside items. I can’t seem to create the static meshes needed for the items properly, they dissappear and give me the wrong asset path.
Code for creating the mesh:
UStaticMesh* StaticMesh = CreateDefaultSubobject<UStaticMesh>( ModelPath );
How a modelpath looks:
__ItemData[ EItems::WEAPON_PISTOL ].ModelPath = TEXT("StaticMesh'/Game/Items/Crowbar/crowbarlow.crowbarlow'");
Reference path to item:
StaticMesh’/Game/Items/Crowbar/crowbarlow.crowbarlow’
Asset path when an item is created, ingame (seems not to be working):
StaticMesh’/Game/TopDownCPP/Maps/UEDPIE_0_TopDownExampleMap.TopDownExampleMap:PersistentLevel.AItem_9.StaticMesh’/Game/Items/Crowbar/crowbarlow.crowbarlow’’
I don’t understand what I am missing. Can anyone enlighten me?