Hi,
I setup a scene where the towers are sending an event to the moving unit (a tank). The tank`s FSM is looking like this:
At start it plays the animation and is going in the "do nothing" state, where is waiting for the enter trigger event from the tower. After that it checks if the health is 0 or grater and if it`s greater is adding -10 every 3 seconds.
When health is "0", the tank gets destroyed. If the tank lives the Tower`s collider area, it receives an trigger exit event and the FSM will go into the "do nothing 2" state.
In the next step, I involved Pool Manager 2 and things are getting complicated a bit. So, I have a few questions:
1. Every instance is getting a new name: Tank(Clone)001, Tank(Clone)002, Tank(Clone)003, etc.
The previous setup it doesn`t work anymore because it was setup for a game object named "Tank".
I created another FSM where, after get spawned the instance name is changed back to the initial name "Tank", so all the instances are named "Tank". I used "Get Name" action, stored the name into a variable and than "Set Name" action. Even so, the setup doesn`t work. The towers are sending the event to the object, but because in the scene are more than one "Tank" objects things are broken.
I was thinking that I need to identify the Tank that is entering the Tower`s collider, and than the tower to send the event to that freshly identified object. And the same for the next one, etc. So, it will be like an dynamic identifier send event action. The tower will send the event to every object that collides. The question is: How do I identify the object that enters the Tower`s collider?
2. The second question is: How do I switch the destination object to which the Tower will send the event.
3. I tried to deSpawn the instances, but I wasn`t able to do it. Can someone post a screenshot or guide me in the right direction?
I think this is the most basic possible setup. Later, will move to more advanced things, but now I`m just trying to take things slow, so that I know what I`m doing.
Any help is highly appreciated.
Cheers,