Hey everyone,
I have had a fun time recently trying to implement a system that allows to store pointers of SkeletalMeshComponent objects within a character. The main characters intention is to grab other Actors Mesh Components and switch to them during gameplay. The character can also switch back to its default mesh.
The issues I’m having is I can’t just store away the pointer to the Mesh because when I change the main characters mesh, he then can’t resolve the pointer to a default skeletalmesh and animinstance.
At this point it is working but I had to use a PCIP.CreateDefaultSubObject in the constructor and set the SkeletalMesh and AnimInstance in PostInitializeComponents(). This gives me the following errors for any Blueprint instance within the world:
I have tried many different ways of changing the mesh using the array like GetDefaultObject(). The main issue here is either I get null pointers or errors. Below I have given the .cpp code of my Character Class.
[Pastebin Link][2]
Is there anything that I am doing wrong? Would you recommend a different approach?