I have the following situation:
1 NPC that follows a path that contains 3 parts. Point of destination 1, Tower Y Point of destination 2.
It turns out that the first NPC that passes through the tower destroys it.
This destruction is not instantaneous. The tower has 100 hit points and while it is in contact with the NPC, it loses 10 life points per second.
With this, the next NPCs will only have to go to Point of destination 1 and finally to Point of destination 2.
I have created a Boolean variable for the destination control (
varTowerDestroyed). So if it's false, the second goal becomes the towerotherwise it becomes the objective point 2.
The plane that shows the variable (varTowerDestroyed) is set to true, just after the destruction of the tower:
Visualization of the control in the destination definition:
It turns out that each NPC has its own variables, so it is useless to define the value of the variable of only one of them. I would need a variable that controlled everything at the same time.
I thought about doing the verification based on a variable of the tower itself, but since the tower will be destroyed, I imagine that the variable will disappear. Impossible to verify:
At the Bueprint Level I created an event that will be called shortly after the destruction of the tower. This event will establish the Boolean variable as true, configuring all the Boolean variables of the NPCs that are created and are still generated as true:
I would calmly call an event if the event were on the plane of the tower, but being on the plane level I did not succeed.
I thought about using the sleep function. I also thought about creating an actor who was a kind of actor manager (I still want to do it, but only when I start using HUD). I also thought about doing a verification of the existence of actors of towers, but I do not know how to do it.
Links of places that I searched: