I am trying to return a value from a c++ function inside of the AI Anim Bp. For some reason the AI’s spine will not rotate not matter how I change the rotation value inside of MSVS. How can I properly return a value within the AI Animation BP? What am I doing wrong? P.S. I can return and set variables fine within the main character’s AI Anim BP using a sequence node. I am trying to add to the pitch and or they yaw and the there is no addition to the rotation parameters.
Below is the function I am using to return the spine rotation value.
FRotator AEnemyAI::SpineReturn()
{
GEngine->AddOnScreenDebugMessage(-1, 20.0f, FColor::Red, FString::Printf(TEXT("Rotation Modded")));
return SpineBoneRotation;
}
Below is the calculation I am using in order to set a value for the spine bone rotation variable.
void AEnemyAI::SpineCalculation()
{
if(AMainCharacter* Player = Cast<AMainCharacter>(UGameplayStatics::GetPlayerCharacter(this, 0)))
{
SpineBoneRotation = Player->GetActorLocation().Rotation() + this->GetActorLocation().Rotation();
}
}