i have a hovertank thing with rockets and guns and missiles and i have them all shooting at a target (a cube)
i want the target to change to whatever object i click on, does anyone know how to do this? i don’t want to have to put a script on every object and then send a message because i will have heaps of things.
Search for mouse raycasting, you’ll find what you need. The idea is to convert the 2d cursor position in 3d, raycast, and then hit.transform gives you the transform of the object you are pointing. Plenty of examples already out there!