- Home /
RTS enemy tracking using triggers
I have a detecter cylinder object surrounding my rts unit. When an enemy enters the cylinder, I need to keep track of the specific enemy to shoot at it, until it either leaves the cylinder or dies. How will I keep track of the enemy, and when the enemy dies, will OnTriggerExit() be called? The enemy is not owned by the owner of the rts unit in the networkview.isMine sense.
Thanks,
MTracer.
Answer by jtbentley · Sep 07, 2010 at 10:55 PM
I actually keep all positions in a built-in array (so there's a unit cap of 128), and it gets called every 0.5 seconds and checks to see what is within engagement range.
Mind you, I'm building with iPhone in mind, so lots of colliders is an expensive idea for me :)
Your answer
Follow this Question
Related Questions
Make an enemy follow a player through network 4 Answers
Compound Triggers with no intermediary exit calls 1 Answer
Enemy Attraction/Aggro 1 Answer
Is There A Way To Disable a Trigger But Still Use OnTriggerExit2D? (For COOP switch management) 2 Answers
How to use NavMeshAgents deterministic for RTS LockStep-Networking? 1 Answer