注意: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属性:

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

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

Cpp代码  [UE4]C++设置AnimInstance的相关问题
  1. USkeletalMeshComponent::SetAnimInstanceClass(UClass* NewClass);  

 具体实例:

Cpp代码  [UE4]C++设置AnimInstance的相关问题
  1. UAnimBlueprintGeneratedClass* MeshAnim = LoadObject<UAnimBlueprintGeneratedClass>(NULL, TEXT("/Game/Character/HeroTPP_AnimBlueprint.HeroTPP_AnimBlueprint"));  
  2. 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

相关文章:

  • 2022-12-23
  • 2021-04-28
  • 2021-11-27
  • 2022-01-05
  • 2021-12-30
  • 2022-02-14
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-18
  • 2021-09-19
  • 2021-10-11
  • 2022-01-03
  • 2022-12-23
相关资源
相似解决方案