[Bug] 4.6 Cannot use Instigator in BluePrints

When getting the instigator from the “Event Any Damage” event on an object, Casting to your Pawn BP or your Controller BP fails. Steps:

  1. In Pawn BP, spawn a projectile
  2. Set the Instigator to your Pawn using Self node. It will not let you set it to the Controller…requires it be a Pawn Node. Also, according to the 4.4 release notes (What's New | Unreal Engine 5.1 Documentation), if you don’t set it, it should automatically take your Pawn as the instigator as the spawning context
  3. In an actor that is receiving damage from the projectile, drag out the instigator and try to cast. There are only the Controller blueprints available to cast, even though it required that you use a Pawn. Under pawns, there is an option to cast to a controller there, but that cast fails also.

Basic problem appears to be that when you set the instigator for the projectile from your Pawn, it requires the instigator be a Pawn class. When you try to use the instigator in a damaged actor, it thinks it’s trying to cast to a Controller.

Running this on Mobile device and Mobile Preview.

PS…using a Mac. Don’t know if Windows works any differently.

I’d say the solution for this would be for the Apply Damage node to check if its Outer blueprint has a projectile movement component, and if so, if the instigator parameter is null it should get the controller of the Outer’s instigator and set that correctly for you.

However, the Apply Damage node is currently an autogenerated node from UGameplayStatics::ApplyDamage so this would require creating a custom K2Node for it.

In the meantime you can use this as a workaround inside your projectile’s blueprint:

23248-getinstigatorcontroller.png

Awesome! That worked. I added the Instigator Controller to the Apply Damage node as suggested, and now it’s working.

Thanks for the help, Twiddle!