您的位置:首页 > 编程语言 > C语言/C++

[UE4]C++设置AnimInstance的相关问题

2017-09-29 14:41 1246 查看
注意:ue4 4.17调用LoadObject<UAnimBlueprintGeneratedClass>直接崩

http://aigo.iteye.com/blog/2285001


UAnimInstance

https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/Animation/UAnimInstance/index.html

 

AnimInstance是Animation Blueprint的C++版本。

角色蓝图中,设置动画蓝图是设置的Anim Class属性:



 

这个设置的步骤如果用C++操作,如下设置:

Cpp代码  


USkeletalMeshComponent::SetAnimInstanceClass(UClass* NewClass);  

 具体实例:

Cpp代码  


UAnimBlueprintGeneratedClass* MeshAnim = LoadObject<UAnimBlueprintGeneratedClass>(NULL, TEXT("/Game/Character/HeroTPP_AnimBlueprint.HeroTPP_AnimBlueprint"));  

Mesh->SetAnimInstanceClass(MeshAnim);  

 

如果想用C++ UAnimInstance代替蓝图动画,那么需要创建一个自己的UAnimInstance,并在其中实现自己的动画逻辑,UAnimInstance里面的具体函数还不熟悉,先标记下,等项目后期再将动画蓝图改为C++。

 

Game Instance, Custom Game Instance For Inter-Level Persistent Data Storage

https://wiki.unrealengine.com/Game_Instance,_Custom_Game_Instance_For_Inter-Level_Persistent_Data_Storage
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: