标签:
UE4 挂接武器
//创建武器
AActor* MeleeWeapon = GetWorld()->SpawnActor<AMeleeWeapon>(
BPMeleeWeapon, FVector(), FRotator() );
if( MeleeWeapon )
{
//通过名字获得骨骼绑点
const USkeletalMeshSocket *socket = Mesh->GetSocketByName(
"RightHandSocket" );
//绑定武器模型到骨骼挂点上
socket->AttachActor( MeleeWeapon, Mesh );
}
Mesh可以是静态模型,也可以是骨骼模型
标签:
原文地址:http://www.cnblogs.com/bodboy/p/5026826.html