# How do you attach a skeletal mesh to an empty character on event play?

**URL:** <https://forums.unrealengine.com/t/how-do-you-attach-a-skeletal-mesh-to-an-empty-character-on-event-play/283675>\
**Category:** Character & Animation\
**Tags:** unreal-engine, CPP, question\
**Created:** [May 18, 2014, 7:10pm UTC](https://forums.unrealengine.com/t/how-do-you-attach-a-skeletal-mesh-to-an-empty-character-on-event-play/283675 "2014-05-18T19:10:10Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Shoiko](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shoiko](https://forums.unrealengine.com/u/Shoiko)\
**Post date:** [May 21, 2014, 11:03am UTC](https://forums.unrealengine.com/t/how-do-you-attach-a-skeletal-mesh-to-an-empty-character-on-event-play/283675/2 "2014-05-21T11:03:07Z")

</div>

Via Rama:

```
template <typename ObjClass>
static FORCEINLINE ObjClass* LoadObjFromPathPTR(const FName& Path)
{
	if (Path == NAME_None) return NULL;
	//~

	return Cast<ObjClass>(StaticLoadObject(ObjClass::StaticClass(), NULL, *Path.ToString()));
}

USkeletalMesh* ARPGParty::getPlayerMesh(int32 index){

	long asd = index;
	if (PartyMemberCount <= index){
		////Con::warnf("WARNING::Party Index out of range: %d", index);
		return nullptr;
	}

	FName name = *PartyMembers[index].DataBlock;
	USkeletalMesh* LoadedObject = LoadObjFromPathPTR<USkeletalMesh>(name);//load the object as per tutorial below or use static load object directly, or use ObjectFinder.

	
	if (LoadedObject)
	{
		return LoadedObject;
	}
	return nullptr;
}

```

Source:

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

---

_[View the full topic](https://forums.unrealengine.com/t/how-do-you-attach-a-skeletal-mesh-to-an-empty-character-on-event-play/283675)._
