So, I was wondering how I would go about making some kind of 'heat seeking' missile that follows a target.
Thing is though, I can imagine the missile just following the target directly (rather than the missile adjusting its rotation to face the target) ... if that makes any sense?
Well lets just take it one step at a time, if you can help me, that would be great.
-- Edit --
I found this:
var targetTag : String;
var target : Transform;
var speed : float = 5;
function Start () {
var tar = GameObject.FindWithTag(targetTag);
if(tar)
target = tar;
}
function Update () {
transform.lookAt(target);
transform.Translate(Vector3.forward*speed*Time.deltaTime);
}
But I get error saying: Cannot convert GameObject into Transform??