Set Timer By Name not allowing non-self references

Looking to make a simple hit stop effect by calling a function whenever the player takes damage. The part where I’m running into issues is that I need to pause both the player and the AI actor at the same time, but for some reason the function I created will not allow me to reference any other target than SELF in the blueprint, despite me setting a specific input actor type in the function.

I noticed in the reference video that their “Set Timer by Function Name” looks a bit different and they are easily able to reference the other actor. Has something changed in UE recently to make this operate differently or am I somehow not using the correct effect?

Any idea on how to ensure I can also reference and affect the AI actor from within the Third Person Character blueprint for this function? 1. Or should I be using this function from a different location than the Third Person Blueprint?

Any suggestions or direction is appreciated.

Because the function you created exists only in the blueprint you created it in. Target exists if you want to call this function in another actor that is the same class (same blueprint).
If you want to execute the same function in another class, first you need to create this function inside this class.

Okay, thanks I think that makes sense. Would this be a use case for creating an interface then? Just having the function live there and get called on each actor to access that info, perhaps?

Do you need to call it on specific actor or all of them?

If specific, if you have ref to it, a simple cast would be much better.

If all, use “all actors of the class”.

Ideally it would be able to affect the Third person character as well as any AI actors I have in the scene. So I would want to be able to call a function or something from either the player or the AI and have the resulting logic be the same for both actors (deal damage and hit pause). I just need to know where the best place to setup this function is so that I can actually reference any of those actors and force them into a hit stop.

In that case interface would be better.

Okay, I’ve setup an interface that just has an input variable (actor) and have that attached to the AI and ThirdPersonBluePrint Character. They both have the same logic that should execute when the interface is called.

However, when I attempt to call the Hit Stop interface event with the references to each actor, nothing appears to happen. Does this setup look correct for each actor?

When I step through with break points, it seems to only run the hit stop interface on the player twice. How would I go about getting it to run or trigger on the AI actor on that second Hit Stop event call instead? I do notice that I don’t have the “Message” icon on the hit stop events and I’m not sure why.

image

Ah yes, I think I had the wrong call there:
image

This appears to at least access the hit stop in the AI target, as expected. Sorry about that, still learning the basic :slight_smile:

Thanks for your help.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.