displaying distance to closest target with multiple targets...
jedikan
Member Posts: 10
How to get distance reading from my player to multiple targets aproaching and get the distance to the closest one.
I known that I need to use functions to get reading to one target but I am lost when I have lots of targets.
The calculation on display are crazy...
Please help step by step as I am new to the advance coding...
Cheers for your help people!
Comments
For multiple targets you will have to make game attributes for the position of each one. And constrain their positions to the game attributes.
Then use the magnitude function to calculate distances, and choose the closest one.
There are lots of explanations on here about the magnitude function.
Not simple what you're doing, though, start small and build up!
Age of Dominion RTS for iOS
Age of Dominion RTS for Android
thank you JScott for answer.
the targets are spawed from 12 diferent points.. so what next? location of spawing points? No... hmmm
@jedikan You got the title of your 2 posts mixed up, thought i was going mad for a minute lol.
I have a old Homing missiles project that might help, project attached.
Space to fire.
Darren.
HEHEHEHEheheheh.......
sorting this out...
thank you...
Hi Darren
the template is grate and i worked for long...
I discovered some problem. your missiles are visible and my are spawed and i still can not do the display to work...
I did the constining the locations and they are working as I got the display separately.
but when i do the distances1 smaller than other attributes
and then display text atribute distance1
nothing is happening.
.... ehhhh
any ideas what is going wrong.
ps I did as well exact way as yours
change attribute to 1...
and
when attribute is 1 then display text...still not working...
hmmm