Hi im new to unity an dive been following the space shooter tutorial. and for some reason when i drag the bolt prefab onto the hierarchy window after ive written the code. it wont work. ive redone the code twice and have read and followed the updated instructions, still nothing works. im using visual studios and not monodevelop. could that be the issue?
here is my code
please help…
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Mover : MonoBehaviour {
private Rigidbody rb;
public float speed;
void start()
{
rb = GetComponent<Rigidbody>();
rb.velocity = transform.forward * speed;
}
},Im new to unity an dive been following the space shooter tutorial. everything is going good so far but for some reason when i drag my bolt onto the hierarchy window during play, the bolt will not move across the screen. Its worth noting i am using visual studios instead on mono develop. and so far it hasn’t cause any errors when writing my scripts.but i follow the updated instructions page as the videos are kinda old, and my script looks the same. i rewatched and followed the video twice to make sure i didnt mess up. im at a loss, please help. also, im thinking i can switch over to monodevelop but im not sure if that will make my code invalid and ill have to completely restart. any suggestions? ive added the code for good measure. unfortunately im not sure ow to take a screen shot. lol.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Mover : MonoBehaviour {
private Rigidbody rb;
public float speed;
void start()
{
rb = GetComponent<Rigidbody>();
rb.velocity = transform.forward * speed;
}
}