I have a project, and it has: 1 NPC (actor X), 2 target points and 1 tower (actor Y).
Image of components in level:
These rose arrows demonstrate part of the NPCs path.
I added a Event Begin Overlap in the blueprint of the NPC so that when it collides with the tower it loses 10 of life every second:
Image of print of variable life:
When the NPC gets 0 life, it goes to the next target point.
But I would like to know how to also modify the life of the tower by the same blueprint (NPC).
The code is already in my mind, it is kind of obvious to speak the truth.
"Code" of NPC blueprint:
I do not want to have to create a new Event Begin Overlap on the blueprint of the tower.
And I think using the blueprint level would not be a good idea.
One of the links below indicated something like Blueprint Interface, but I'd like to know if I can do what I want for the NPCs own blueprint.
Links:
https://forums.unrealengine.com/international/brazil/89438-pegar-vari%C3%A1vel-de-outro-blueprint
https://answers.unrealengine.com/questions/21386/communication-between-2-blueprints.html?sort=oldest
https://docs.unrealengine.com/en-us/Engine/Blueprints/UserGuide/Types/Interface