I've been using Call Function events for my various integrations and it was working fine when I called a function on a component on the Player, but now I have a DamageZone with an event on an enemy AI and when I use Call Function in that event, the function never gets called. The only thing that I think that is different is that on the one that works, the Event Settings have the Player actor added and the Target is set to Actor/Player. However, the enemy AI is not the Player, but I can't figure out what I'm supposed to set as the Target so that the function will get called on the enemy AI. I've tried various different options, but nothing seems to work.
The attacker is available as Starting Object actor.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Status Value: HP
Used Value: Current Value
Variable Settings
Variable Origin: Local
Variable Key
Value Type: Game Variable
Value: HP
Variable Origin: Local
Operator: Set
But the value that gets sent to my function when I tell it to use the HP Local GameVariable is always 0. I increased the health of the AI so that it won't die in a single attack so I know the value can't be going to 0 in one attack.
What confused me the most is that there are 2 Variable origin settings and I have no idea why.
Using Game Variable as value type for a variable key will use the (string) value that is stored in the defined key.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Depending on the Value Type:
Value: The text will be used as value.
Game Variable: The text is the key (name) of a game variable (string) that holds the value that will be used.
To me that means the Value is the key name of the variable that stores the value, which is exactly what I want. But you say to use Value, which says the text will be used as the value, which to me means that the Value is going to be whatever I type in that field.
I guess it just doesn't make sense. When I look at it, I think that the Status value is going to be stored in the Game Variable indicated by the Value key that I specify.
But, what you suggest does work. It just doesn't make sense.
[EDIT]
Nevermind. We did specify HP in the Value. My bad.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!