How do I get animation blueprint from BTTask? I want to set a variable there, to signal it to play the death animation. Why doesn’t Destroy Actor have any effect in this task?
One thing you’re missing here, that causes your issues, is that OwnerActor in EventReceiveExecute is a Controller not a Pawn. So when you call destroy you don’t destroy the pawn on the level, you destroy his brain!
To get access to AnimInstance of your AI you need a sequence of calls:
cast OwnerActor to a controller
from the controller get the pawn with GetControlledPawn call
cast retrieved pawn to Character class
from resulting character instance get its skeletal mesh with GetMesh call
you can get AnimInstance from the mesh with GetAnimInstance call
Works like a charm, thanks!
I forgot that Controller is also an Actor. The plug OwnerActor tooltip says “object’Actor’ Owner Actor”, my wires short-circuited and I assumed it must always be the character/pawn