I have the following situation:
1 NPC that follows a path containing 3 parts. Target Point 1, Tower and Target Point 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 in contact with the NPC, it loses 10 life points every second.
With this, the next NPC’s will only have to go to Target Point 1 and finally to Target Point 2.
I created a boolean variable for target control (varTowerDestroyed). So if it is false, the second target becomes the tower, otherwise it becomes the target point 2.
Blueprint showing the variable (varTowerDestroyed) being set to true, right after the tower’s destruction:
**Display of the control in the target definition:
It turns out that each NPC has its own variables, so there’s no use in defining the value of the variable of just one of them. I would need a variable that would control all at the same time.
I thought of doing the verification based on a variable of the own tower, but as the tower will be destroyed, I imagine the variable will disappear. Impossible to verify:
At the Level Bueprint I created an event that will be called soon after the tower’s destruction. This event will set the Boolean variable to true, setting all Boolean variables of the NPC’s that are created and still generated to be true:
I would calmly call an event if the event was in the blueprint of the tower, but being on the blueprint level I was unsuccessful.
I thought about using the sleep function. I also thought about creating an actor who was sort of an actor manager (I still want to, but only when I start using HUD). I also thought about doing a check of the existence of tower actors, but this I do not know how to do.
Links from places I searched:
I also saw this video, but I could not: