Targeting an enemy trouble

Ill make it simple:

I would like a code that when i click on my enemy , my enemy gets targeted.

Cant find it online :confused:

I got a 3rd person camera and my main camera is removed.

Since this is a really vague question my options of helping you are limited. But you could use ScreenPointToRay to cast a ray from the Input.mousePosition and attach the enemy as a target:

//Attatch to camera
var target : GameObject; //The target you want to attack

function Update (){
    var hit : RaycastHit;
        var ray : Ray =;
        if(Physics.Raycast(ray, hit)){
            if(hit.collider.tag == "Enemy"){
                target = hit.collider.gameObject;
    //Continue logic

Basic example. Hope it gets you going.