Hi, I’m trying to create an WolfAI( using C++). These are the steps I have followed
i) Created a new C++ class for Wolf AI…derived from Character class.
ii) Created a new AI-Controller C++ class. And added AIPerception Component to it… AI-Controller is handling the logic for OnTargetDetected(AActor* Actor, FAIStimulus const Stimulus) and running behavior tree.
iii) I have created Custom Behavior tree tasks and Services in C++…
My question is that , how to access the AI’s AnimInstance and update values of variables so that the animation state changes (from Idle to Running) from Behavior tree tasks(C++)?
I tried in this way , and created some public functions in AnimalAI class for setting/updating speed ,but still no use
Super::OnBecomeRelevant(OwnerComp, NodeMemory);
auto* AnimalAI = Cast(OwnerComp.GetAIOwner());|
auto* Animal = Cast(AnimalAI->GetPawn());|
The other issue I have observed is that… when I try to set MaxWalkSpeed of character (AI wolf) from BTService(Created in C++) the NativeUpdateAnimation() in AnimInstance is stopped working.
Can anyone tell me where i’m doing wrong. Or is there any other approach?
Thanks.