I am new to Unity and am running through the Space Shooter tutorial. I have manage to follow it OK up to step 6, I am now having trouble getting the laser ‘bolt’ to move as the script commands seem to be different.
This is the script used in the original video:
public class Mover : MonoBehaviour
{
public float speed;
void Start ()
{
rigidbody.velocity = transform.forward * speed;
}
}
I have looked at the document that details the changed for Unity 5.x and this is what I now have:
public class Mover : MonoBehaviour
{
public Rigidbody rb;
void Start()
{
rb = GetComponent();
rb.velocity =
}
}
I dont understand how I set the speed with this new script? With the old script the speed option will appear inside the project. The document does not say what to put after rb.velocity =.