Hello, I am currently making a strategy game in which you could combine units together to make them bigger.
For example, if you want to combine 2 units of archers, with one archer in the first unit, and 3 on the other one, you can make them overlap so that it makes a single unit of 4 archers.
For the moment I only added animations on archers, depending on how many there are in a unit (animation 1 has 1 archer, animation 2 has 2 archers, etc.. and it goes up to 4)
I added a variable called number, which modifies the animation (if number=1 => play animation 1, if number=2 => play animation 2 , etc...)
I would like to make this:
Condition:
Archer Unit 1 is overlapping Archer Unit 2
Archer Unit 1 Number + Archer Unit 2 Number < 4
Action:
Destroy Archer Unit 1
Add Archer Unit 1 Number to Archer Unit 2 Number
How do I compare variables between two same objects?