Why is this script for bolts in space shooter not working?

i am taking space shooter for unity. i added this script to parent bolt game object. but it doesnt work.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Mover : MonoBehaviour {
public float speed;
private Rigidbody rb;
void Start()
{
rb.velocity = transform.forward * speed;
}

}

the bolt doesnt move when i play and place the object from prefab as told in tutorial. why? pls help.

From your script, you would have to put a value for speed in the editor. Did you do that? You click on the object, then look at the script in the inspector, and there should be a place to add speed.

yes i did. that wasn’t a issue. i got where i was wrong. the tutorial is for 4 and i have 7.1. so i had to specify getcomponent which i didn’t. i did it. now its working. thnks.