Hi all,
I’m currently working on an animation-driven attack system using Unreal Engine (v5.5). I’m trying to call a custom C++ function SetIsAttacking(bool)
from my Enemy
class within an AnimNotify
event in my Animation Blueprint (MainAnim_BP
).
Here’s the function in Enemy.cpp:
cpp
void AEnemy::SetIsAttacking(bool Attacking)
{
bIsAttacking = Attacking;
}
The header (.h):
UFUNCTION(BlueprintCallable)
void SetIsAttacking(bool Attacking);
UPROPERTY(BlueprintReadOnly)
bool bIsAttacking;
In my Animation Blueprint, I want to call this from `AnimNotify_AttackEnd`, but the "Set Is Attacking" node gives me an error:
**“HOTRELOAD Enemy 0 Object Reference is not compatible with Enemy Object Reference.”**
Here's what I've tried:
* Verified `SetIsAttacking` is marked as `BlueprintCallable`.
* Confirmed that the `Enemy` variable is correctly set in the Anim BP.
* Added validation checks for null pointers before calling.

Screenshots for clarity:

It should be as like the one below
