Download

Dynamically loading skeletal is not working

I’m just trying to load the player information from my database string but when I use this it is not working:




USkeletalMesh* ARPGParty::getPlayerMesh(int32 index){

	long asd = index;
	if (PartyMemberCount <= index){
		////Con::warnf("WARNING::Party Index out of range: %d", index);
		return nullptr;
	}
															  //SkeletalMesh'/Game/RPGEngine/Actors/Characters/TheWarrior/TWar_Actor.TWar_Actor'
															  //mesh(*(PartyMembers[index].DataBlock));
	static ConstructorHelpers::FObjectFinder<USkeletalMesh> mesh(TEXT("SkeletalMesh'/Game/RPGEngine/Actors/Characters/TheWarrior/TWar_Actor.TWar_Actor'"));// );
	return mesh.Object;
}


No matter if i use the direct string or the database string it crashes in the constructor. I’ve checked and this seems to work for everyone else. I am getting the string directly from the content browser.

I’m just trying to load the skeletal and animation bits dynamically. Is there any other way to achieve this using sting values?

I believe you want something more like this:


USkeletalMesh* LoadedObject = //load the object as per tutorial below or use static load object directly, or use ObjectFinder.

**//The critical part**
if(LoadedObject && Mesh)
{
  Mesh->SetSkeletalMesh(LoadedObject);
}


**Dynamic Load Object Wiki**

https://wiki.unrealengine.com/Dynamic_Load_Object

AnswerHub

Another answer here:
https://answers.unrealengine.com/questions/35817/create-a-uskeletalmesh-from-reference-name.html

I’ll try this as soon as i get home. As for the other answer. That was one of the ones I tried above the only difference is that I have a system class that is storing the meshes to pass to other AI instances so the RPG_SYSTEM will always have a link to the main control mesh changed only via database. But that’s what failed.

Can’t wait to try out the Dynamic load thanks.

One question sir, The object you are loading is the path the path of the object from the CB or the HDD?

YOU SIR ARE AWESOME!

O_Ov

I’m assuming i can do this for any type now to do it for the animation type.

flutters away in programming freedom!