Search Unity

Experiencing problems with space shooter tutorial

Discussion in 'Community Learning & Teaching' started by Primestriker, Sep 29, 2015.

Thread Status:
Not open for further replies.
  1. Primestriker

    Primestriker

    Joined:
    Sep 29, 2015
    Posts:
    1
    I am on the section where the you set up the bolts being fired from the ship. The problem is the bolts are not appearing. If I view it from scene view they are being fired, but in a straight up vertical position, so you cant see it from top down view. The quad is laid correctly at 90 degrees. If I drag the bolt prefab out onto the sceneview it shows up correctly. Here's the code for reference.

    public GameObject shot;
    public Transform shotSpawn;
    public float fireRate;

    private float nextFire;

    void Update ()
    {
    if (Input.GetButton("Fire1") && Time.time > nextFire)
    {
    nextFire = Time.time + fireRate;
    // GameObject clone =
    Instantiate(shot, shotSpawn.position, shotSpawn.rotation); // as GameObject;
    }
     
  2. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
Thread Status:
Not open for further replies.