Homing Missile Part 1

How to create a homing missile

Create a Homing Missile Prefab

Our Homing Missile Prefab with box collider

Pseudocode Homing Missile

Script

void Update()
{
_direction = (_target.transform.position — transform.position).normalized * _speed;
transform.Translate(_direction * Time.deltaTime); //self destruct
if (_target.gameObject == null)
{
Destroy(gameObject);
}
}

Aspiring developer that’s self-learning Unity & C# to transition to a career with Unity. I got a passion for creating interactive experiences.