homing missiles and transform and colission help c#

ive been looking everywhere online for some help with coding a homing missile in unity
can any one help and tell me where i am going wrong

public Rigidbody projectile;
public float speed = 10.0f;
Public Transform target;

void Update() {
if (Input.GetButtonDown("Fire1")) {
Rigidbody clone;
clone = Instantiate(projectile, transform.position, transform.rotation) as Rigidbody;

clone.velocity = transform.TransformDirection(Vector3.forward * speed);	



void OnCollisionEnter(Collision collision){



the code used to just shoot the projectile in front of the character and would bounce off the walls and then after 5 seconds it would be destroyed
after i tried implementing destroying the object when ever it collides with something and trying to make it go towards the given target it doesn’t even move now

can i please get some help I’ve tried looking online for tutorials but they are all in java and I’ve tried converting the code to c# but it doesn’t work

enter code here

You must add the OnCollisionEnter event to the projectile script, not to the creator’s:

// projectile script:
void OnCollisionEnter(Collision collision){
  // <- instantiate the explosion here, if you want ->
  Destroy(gameObject); // destroy projectile