I have a tower defense game where you are trying to stop robots. There are different robot enemy/object types and they are al contained in a Family called "Robots".
When I spawn an object from Robots, I also:
- Spawn a text object called "RobotsHealth"
- Pin "RobotsHealth" to Robots
- Set Text of "RobotsHealth" to the current health of that robot.
So, far so good, this works perfectly (the starting health values move with the robots).
However, when bullets hit "Robots", I want to update the value of "RobotsHealth" and I have this code:
- Bullet1 On collision with "Robots" -> RobotsHealth | Set text to Robots.Health
But this is changing the value for EVERY instance of "RobotsHealth".
How do I change just the value for instance of "RobotsHealth" that is pinned to the "Robots" that was hit?