How do I do this without casting to my animation blueprint?

I was watching a tutorial on the mistakes that beginners make, and it was about using event dispatchers instead of casting.

Here in my animation blueprint, I’m calling my event dispatcher when my custom anim notify happens:

Now in my character blueprint, I’m binding to that event dispatcher, but I see that I need to plug something into the target, and it has to be about the anim object reference, but I can do it only with casting:

How do I do it without casting to my animation blueprint? And can this really be done with event dispatchers?

And try to get out of it using interfaces before event dispatchers imo.

If this is being done in the animBP used by your character, why would you not just cast to the characters BP once during the initialize in the AnimBP event graph? The character will always be using the animBP, so it would only make sense to have a direct reference to the character. If this is the case then I would just check the condition with a boolean.

Casting isn’t so bad if you’re always going to be directly tied to the BP you’re casting to. What you want to avoid is casting to every door and object that you will possibly ever interact with.

Is it correct that with blueprint interfaces, this can’t be done if I don’t use casting?

An interface will need a target, so you don’t specifically need a reference to your particular character BP, “get player character” should work fine. Though as I mentioned previously, is this the characters only animBP? If so, I would just cast to the specific character BP that’s utilizing it in the initialization of the AnimBP. Theres really no harm to doing this. It will save you a lot of effort in making different interface functions for every single check if you just get the players reference once.

(post deleted by author)