Problems with Overlaping and Tags

Hello everyone.

The problem is that I have created an actor called “Fire” and a character “Enemy”. The idea is that when the enemy overlaps with the fire, the fire reads the enemy’s tag that I put down, and if it is the correct, it calls a function from the enemy that will take health, etc, but this is not working. First, I checked with a print if the fire was reading correctly the tag, and the answer is NO, whatever I do and to which element of the actor I put the tag.

Second, even if it worked, how could I cast to that specific enemy if I can’t use “get player character” and there may be more than 1 enemy of the same type? Should I create any type of references from the world outliner or somewhere else, or is there a better way?.

I found an alternative to get what I want, but it’s very messy and I’m sure there must be a better way. To finish, I’ll let you know that both enemy and fire have collision boxes, and if I try to read a tag that I put on the fire actor from my enemy, it does work, so I don’t understand why it dowsn’t the other way round. Hope you can help me and thanks.

It would be nice if you provided some screenshots or code excerpts, e.g., places where you’ve put the tags. Probably you put tags on some actor component but checked actor tags or something.

As for casting, you don’t need to get player character, you can cast the reference from OverlappedActor directly to the class you need

OK, I did it again and now it seems to recognise the tags and to work well. I don’t know why because I did exactly the same. Thanks for your answer.