Tower Target Random Tank

Okej, im trying to do a little game and its about 2 tanks fighting on a platform and some few towers are placed on the map and when any of the tanks drive close to one of the towers, the tower should shoot at the tank thats in the range and if both tanks are there the tower should shoot at the first on to enter the range.

but i dont know what kinde of java-script i should put on the tower

any one have any idea ? :)

You would use a trigger and the `LookAt` function, as well as `Instantiate`, for the turret's head to shoot. When the tank enters the trigger, it makes itself the target of the tower, which then looks at it and starts shooting. That's the idea, anyhow.