Download

Referencing Enemy Boolean Variable to Adjust Attack Damage

Hopefully, this should be an easy answer, I am creating a script for an enemy character that when I collide with an item called “RubysFury” a boolean variable will be set from False to True on my enemy character. The boolean controls two execution paths through a branch node. The true path ups my characters damage X2 and the false path set it to half of the true path. I have print strings on the actor overlap event that is supposed to set the variable to true on my enemy character, and on each branch of my enemy damage script.

Below shows the blueprint scripts in the RubysFury actor as well as the damage increase script. Please help me understand how to reference the Enemy Character in the actor blueprint so I can update the variable in the Enemy Character when I overlap the RubysFury Actor.


If there’s only one spider, then just use GetActorOfClass to get a reference to it.

1 Like

There is only one Spider Blueprint but I have multiple Spider instances in the game,eg I have dragged the Blueprint in multiple times into the game to create multiple enemies. Would this still work?

Then you need to use GetAllActorsOfClass, but need some way of telling the spiders apart. You could use actor tags for that ( I don’t know your situation ).