Hi Everyone,
Here is the scenario...
I have a mining ship and 2 asteroids.
When I right click the ship it uses the bullet behavior to move towards the asteroid I clicked.
When the ship gets within 100 pixels of the asteroid it stops using the distance(x,y,x,y) code.
All good so far and working as intended.
When I then right click the second asteroid, the ship moves towards it but doesn't stop at 100 pixels away. It bump right into it.
So it only seems to use the 100 pixels away part on the first asteroid clicked and not the second.
So I added a variable to the ship that saves the UID of the asteroid that was clicked.
So 2 issues...
1. Why does the distance check only work on the first asteroid clicked and not the second?
2. How do I use the distance(x,y,x,y) to test the distance to a specific UID and not just an object?
This gives an error:
Here is my code...
Thank you in advance.