I'm building a targeting system where a player can double click an object and set it as the attack target.
When a target is selected, I note down the peer id.
What is should do?
If a player sets a target, the distance between the attacker and the target should be calculated in a loop.
Since both objects are of the exact same type, I can't reference them correctly in the loop.
Can I select 2 different objects inside a foreach loop?
As an example:
Pick object Player by peer id 1 as Player1
Pick object Player by peer id 2 as Player2
Calculate distance of Player1 and Player2
The code is pretty much a template multiplayer game code, the problem starts at line 71.
If you can help, would be really nice.