I have a subclass of UAnimNotify which needs to do a sweep test starting from an arbitrary socket. Getting the transform to center the test on seems pretty trivial:
However, animation notifies don’t live on the ACharacter like a component, they exist somewhere in UE4’s ether and only get called when you set them up in Persona. To that end, is there a way I can get a reference to the character or mesh whose animations are triggering the notify?
And this is the error it produces:
""Error HitframeNotifyState.cpp.obj : error LNK2019: unresolved external symbol “public: struct FTransform __cdecl UHitframeNotifyState::SetHitboxLocation(class FString,class USkeletalMeshComponent *)” (?SetHitboxLocation@UHitframeNotifyState@@QEAA?AUFTransform@@VFString@@PEAVUSkeletalMeshComponent@@@Z) referenced in function “public: virtual void __cdecl UHitframeNotifyState::NotifyTick(class USkeletalMeshComponent *,class UAnimSequenceBase *,float)” (?NotifyTick@UHitframeNotifyState@@UEAAXPEAVUSkeletalMeshComponent@@PEAVUAnimSequenceBase@@M@Z)
"
You can obtain within Notify event your MeshComp(owner of the animation and notify)
And if you want to get a pawn reference just call
MeshComp->GetOwner() and try cast it to your character or something.
I’ll suggest make SetHitboxLocation as a member of class UHitframeNotifyState
but if you want to leave it as global put it before UHitframeNotifyState::NotifyTick in the code.
…so I cannot believe I did that, this is like the fifth time in as many days I’ve had a weird, unexplained error that was caused by me forgetting to scope the function properly. It works now, thank you so much!! This has been bothering me for well over a week