Search Unity

Space Shooter Tutorial Q&A

Discussion in 'Community Learning & Teaching' started by Adam-Buckner, Mar 26, 2015.

  1. prashant2000

    prashant2000

    Joined:
    Nov 24, 2016
    Posts:
    1
    Have you set the value of speed to something???
     
  2. feihp

    feihp

    Joined:
    Nov 23, 2016
    Posts:
    4
    I set speed 20, with the same video.
     
    Last edited: Nov 25, 2016
  3. faheem889

    faheem889

    Joined:
    Nov 19, 2016
    Posts:
    2
    Check mesh collider's check option convex is checked
     
  4. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    Morning,

    One important thing to be aware of is that C# is case sensitive. and when dealing with things like Start() FixedUpdate() etc these have to be in the correct spelling and case, otherwise they wont get called, it wont show an issue in the editor, it just wont work.

    in your mover script you currently have
    Code (CSharp):
    1. void start ()
    this needs to be changed to the following with a capital S.
    Code (CSharp):
    1. void Start ()
     
  5. VCQN

    VCQN

    Joined:
    Nov 25, 2016
    Posts:
    2
    On lesson 12, I don't really understand the use of
    Code (csharp):
    1. Quaternion.identity
    What does this exactly do? The definition from the documentation "This quaternion corresponds to "no rotation" - the object is perfectly aligned with the world or parent axes." tells me nothing, I do not understand how this made the asteroid rotate.
     
  6. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    Quaternion.identity basically ( as I understand it) resets the rotation of the object to be aligned with the world space coordinates.

    usually nice when you instantiate an object in the scene, as you explicitly tell it to have its original rotation when its added.

    Rotating an object is something else, you have to tell the object how to rotate, either by using the Transform.rotate or applying some physics torque/angular velocity to its Rigidbody.

    as in the RandomRotator script in the lesson
    Code (CSharp):
    1. rigidbody.angularVelocity = Random.insideUnitSphere * tumble;
    this basically takes a vector from the centre of a one unit sized sphere to a single point on its surface and used that vector as a directon, then multiply by the tumble value, which is in essence a rotate speed.
    then that value is applied to the physics rigidbody as an angular velocity.
     
    Skyho and PlayCreatively like this.
  7. VCQN

    VCQN

    Joined:
    Nov 25, 2016
    Posts:
    2
    By the way, I think I understand now. It was my fault for missing it, yes the Quaternion.identity resets the rotation and that class method wasn't the cause of the rotation at all. In the previous lessons he made a script called RandomRotator, that's where the rotation came from. So using Quaternion.identity is his way of making sure that the object starts with no rotation.
     
    OboShape likes this.
  8. Emoangel_1478

    Emoangel_1478

    Joined:
    May 20, 2016
    Posts:
    4
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. [System.Serializable]
    5. public class Boundary
    6. {
    7.     public float xMin, xMax, zMin, zMax;
    8. }
    9.  
    10. public class PlayerController : MonoBehaviour
    11. {
    12.     private Rigidbody rb;
    13.     public float speed;
    14.     public float tilt;
    15.     public Boundary boundary;
    16.  
    17.     public GameObject shot;
    18.     public Transform shotSpawn;
    19.     public float fireRate;
    20.  
    21.     private float nextFire;
    22.  
    23.     void Start()
    24.     {
    25.         rb = GetComponent<Rigidbody>();
    26.     }
    27.  
    28.     void Update ()
    29.     {
    30.         if (Input.GetButton("Fire1") && Time.time > nextFire)
    31.             {
    32.             nextFire = Time.time + fireRate;
    33.                 GameObject clone =
    34.                     Instantiate (shot, shotSpawn.position, shotSpawn.rotation); // as GameObject;
    35.  
    36.                 // create code here that animates the newProjectile      
    37.             }
    38.     }
    39.     void FixedUpdate ()
    40.     {
    41.         float moveHorizontal = Input.GetAxis("Horizontal");
    42.         float moveVertical = Input.GetAxis("Vertical");
    43.  
    44.         Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical);
    45.         rb.velocity = movement * speed;
    46.         rb.position = new Vector3
    47.         (
    48.             Mathf.Clamp (rb.position.x, boundary.xMin, boundary.xMax),
    49.             0.0f,
    50.             Mathf.Clamp (rb.position.z, boundary.zMin, boundary.zMax)
    51.         );
    52.  
    53.         rb.rotation = Quaternion.Euler (0.0f, 0.0f, rb.velocity.x * -tilt);
    54.     }
    55. }
    On line 39 I am getting an error saying that void can not be used in this context. I have the mesh collider convex on. I have no idea what I did wrong.
     
  9. malcolmchalmers

    malcolmchalmers

    Joined:
    Nov 27, 2016
    Posts:
    6
    Hi All,
    I need a bit of help with lesson 7 - "Shoot shots"

    If I put the code to shoot the shots, something like this...
    Code (CSharp):
    1.      
    2.     void update()
    3.     {
    4.         if (Input.GetButton("Fire1") && Time.time > nextFire)
    5.         {
    6.             nextFire = Time.time + fireRate;
    7.             Instantiate(shot, shotSpawn.position, shotSpawn.rotation);
    8.         }
    9.     }
    10.  
    in the Update method, it doesn't work. Nothing happens when i tap the Fire1 button.
    However, if I put it in the FixedUpate method, it does work.

    what am I doing wrong ?
     
    Last edited: Nov 27, 2016
  10. feihp

    feihp

    Joined:
    Nov 23, 2016
    Posts:
    4
    The problem is solved, thank you for your help!!!!!
     
  11. feihp

    feihp

    Joined:
    Nov 23, 2016
    Posts:
    4
    The problem is solved, thank you for your help!!!!!
     
  12. malcolmchalmers

    malcolmchalmers

    Joined:
    Nov 27, 2016
    Posts:
    6
    Ha Ha. This fixed my problem as well!
    Except I was doing it with the Update method. :)
     
    OboShape likes this.
  13. Goby03

    Goby03

    Joined:
    Nov 11, 2016
    Posts:
    11
    Hello !
    I wrok with unity3D 5 and I have some problem to understand what change in the code with the version 5.
    I try do to this part of the tutorial. I am at 6:49. I wrote this code :
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class PlayerController : MonoBehaviour {
    5.  
    6.     private Rigidbody;
    7.     void Start ()
    8.     {
    9.         rb = GetComponent<Rigidbody>();
    10.     }
    11.     void FixedUpdate ()
    12.     {
    13.         float moveHorizontal = Input.GetAxis ("Horizontal");
    14.         float moveVertical = Input.GetAxis ("Vertical");
    15.  
    16.         Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
    17.  
    18.         rb.AddForce = movement;
    19.  
    20.     }
    21. }
    22.  
    But I have an error into the console :
    I don't find the error.
    Could you help me ?
     
  14. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    Evening,

    within this line of code on line 6 you have
    Code (CSharp):
    1. private Rigidbody;
    you have the scope and the type, but you have not written the variable name 'rb' to hold the Rigidbody reference, this needs to be changed to
    Code (CSharp):
    1. private rb Rigidbody;
     
  15. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836

    on line 34 i can see your instantiate statement.
    you have declared a variable 'clone' to hold a GameObject type variable.

    but, instantiate on its own, returns an Object type, so, it will show an error if you do not explicitly cast the Instantiated object as a GameObject type to be able to store it in your 'clone' variable.

    so add back in the 'as GameObject;' at the end.
    Code (CSharp):
    1.  
    2. GameObject clone =
    3. Instantiate (shot, shotSpawn.position, shotSpawn.rotation) as GameObject;
    If your still getting errors, can you copy the error in the console and paste it in please.
     
  16. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    Sound :) , yep watch out for the CaSe sEnsitiVity, as it wont throw any errors for these Mono methods, it just wont call em.
     
  17. Wishram

    Wishram

    Joined:
    Nov 19, 2016
    Posts:
    1
    Res and aspect.png Hey guys, I've looked all over for a solution for this, so I apologize if something on this has already been posted.

    I've changed the screen height/width as the setup video says to do, but there is no option for choosing "Web" under the aspect selection menu. I am using WebGL.

    Thanks for the help!
     
  18. Goby03

    Goby03

    Joined:
    Nov 11, 2016
    Posts:
    11
    I edit the line of code 6 with what you suggest. And now I have an other console error :

     
  19. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    Oh pants, sorry thats my bad typing in a hurry :( sorry for the confusion

    it should be scope, type, name.
    Code (CSharp):
    1. private Rigidbody rb;

    I should have double checked my typing i do apologise :(
     
  20. Goby03

    Goby03

    Joined:
    Nov 11, 2016
    Posts:
    11
    No problem. ;)

    I corrected but I have an error alert again. :(

     
  21. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    when using the AddForce on the Rigidbody, its a method, so needs to be used like below

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class PlayerController : MonoBehaviour {
    5.  
    6.     private Rigidbody rb;
    7.     void Start ()
    8.     {
    9.         rb = GetComponent<Rigidbody>();
    10.     }
    11.     void FixedUpdate ()
    12.     {
    13.         float moveHorizontal = Input.GetAxis ("Horizontal");
    14.         float moveVertical = Input.GetAxis ("Vertical");
    15.  
    16.         Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
    17.  
    18.         rb.AddForce(movement);
    19.  
    20.     }
    21. }
     
    Goby03 likes this.
  22. Deleted User

    Deleted User

    Guest

    I want to make it so when you shoot it triggers the game to pause and you have to answer a question correctly or the game ends
     
  23. Goby03

    Goby03

    Joined:
    Nov 11, 2016
    Posts:
    11
    Thank you very much ! It works ! :)
     
  24. Drakkith

    Drakkith

    Joined:
    Nov 29, 2016
    Posts:
    57
    I'm having an issue getting the explosion clones to be destroyed. I've written the code exactly how the tutorial states and I've applied the script to all 3 types of explosions but nothing happens. Here's my code:

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class DestroyByTime : MonoBehaviour
    5. {
    6.     public float lifetime;
    7.  
    8.     void start()
    9.     {
    10.         Debug.Log("Boom");
    11.         Destroy (gameObject, lifetime);
    12.  
    13.     }
    14. }
    It doesn't matter what I set lifetime too, or even if I manually input a value or remove lifetime completely. The explosion clones just keep piling up. The Debug.Log("Boom") doesn't even send a message to the console, so it's like this script is never even called.
     
  25. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    Morning,

    You have to watch out for case sensitivity in C#, where you have.
    Code (CSharp):
    1. void start()
    needs to be changed to have a capital S at the start...
    Code (CSharp):
    1. void Start()
     
  26. Drakkith

    Drakkith

    Joined:
    Nov 29, 2016
    Posts:
    57
    Sigh... it's always something simple...
    Thanks for the help!!
     
  27. ivancreatorstudio

    ivancreatorstudio

    Joined:
    Dec 3, 2016
    Posts:
    1
    I can't download the assets on my computer. Please help me!!!
     
  28. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    Have you tried opening the Asset Store from within the Unity editor see if that works?
    Window > Asset Store
     
  29. Deleted User

    Deleted User

    Guest

    What exact version did you do it on?
    was it unity 4.3.0
     
  30. Emoangel_1478

    Emoangel_1478

    Joined:
    May 20, 2016
    Posts:
    4
    Thank you that helped me.
     
  31. Sidius89

    Sidius89

    Joined:
    Dec 7, 2016
    Posts:
    1
    Hi there

    I'm having an issue with setting up my lighting, in the tutorial it says to "remove the skybox by selecting it and deleting it" and "Make sure the Skybox is "none"" but I'm having an issue about actually deleting it

    http://i.imgur.com/P3fokTr.png
     
  32. Mutation1

    Mutation1

    Joined:
    Apr 22, 2016
    Posts:
    6
    Can anyone advise and point me in the direction on how to code 2 player version of this game in split view?

    I am relatively new to programming.

    Any help is greatly appreciated

    Mutation1
     
  33. wimolsuntirungsi

    wimolsuntirungsi

    Joined:
    Dec 10, 2016
    Posts:
    39
    Can I use some of character from this asset to make game and sell it?

    or it allow only for learning
     
  34. TeddyPhoenixTam

    TeddyPhoenixTam

    Joined:
    Dec 10, 2016
    Posts:
    1
  35. Anm8or

    Anm8or

    Joined:
    Dec 12, 2016
    Posts:
    1
    GameController.PNG GameController.PNG GameController.PNG Hello All and thank you to the devs for making this tutorial. Has taught me a lot and by no means is it the last I will do. I am currently having an issue with my version of the game. I believe that I have followed the tutorial closely and there is some issue with the syntax that I cannot seem to find the answer for. I have completed everything and am ready to build, however when I play the game my asteroids spawn, my ship moves and fires, everything explodes with audio, I get a wave of asteroids that matches my count, the asteroids do not spawn until the game has started for one second, my text displays in the correct locations, my score adds up however when an asteroid or my ship explodes I get game over or if I just let all the asteroids pass by only 1 wave spawns and then when the wave stops I get game over. I am not getting any error messages altho I do get a couple of warnings that tells me that (int) is obsolete. I am posting my Controller, Player and Destroy scripts in hopes of some assistance.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class GameController : MonoBehaviour
    5. {
    6.     public GameObject hazard;
    7.     public Vector3 spawnValues;
    8.     public int hazardCount;
    9.     public float spawnWait;
    10.     public float startWait;
    11.     public float waveWait;
    12.  
    13.     public GUIText scoreText;
    14.     public GUIText restartText;
    15.     public GUIText gameOverText;
    16.  
    17.     private bool gameOver;
    18.     private bool restart;
    19.     private int score;
    20.  
    21.     void Start ()
    22.     {
    23.         gameOver = false;
    24.         restart = false;
    25.         restartText.text = "";
    26.         gameOverText.text = "";
    27.         score = 0;
    28.         UpdateScore ();
    29.         StartCoroutine (SpawnWaves ());
    30.     }
    31.  
    32.     void Update ()
    33.     {
    34.         if (restart)
    35.         {
    36.             if (Input.GetKeyDown (KeyCode.R))
    37.             {
    38.                 Application.LoadLevel (Application.loadedLevel);
    39.             }
    40.         }
    41.     }
    42.  
    43.     IEnumerator SpawnWaves ()
    44.     {
    45.         yield return new WaitForSeconds (startWait);
    46.         while (true)
    47.         {
    48.             for (int i = 0; i < hazardCount; i++)
    49.             {
    50.                 Vector3 spawnPosition = new Vector3 (Random.Range (-spawnValues.x, spawnValues.x), spawnValues.y, spawnValues.z);
    51.                 Quaternion spawnRotation = Quaternion.identity;
    52.                 Instantiate (hazard, spawnPosition, spawnRotation);
    53.                 yield return new WaitForSeconds (spawnWait);
    54.             }
    55.             yield return new WaitForSeconds (waveWait);
    56.  
    57.             if (gameOver)
    58.             {
    59.                 restartText.text = "Restart Game Press 'R'";
    60.                 restart = true;
    61.                 break;
    62.             }
    63.         }
    64.     }
    65.  
    66.     public void AddScore (int newScoreValue)
    67.     {
    68.         score += newScoreValue;
    69.         UpdateScore ();
    70.     }
    71.  
    72.     void UpdateScore ()
    73.     {
    74.         scoreText.text = "Score: " + score;
    75.     }
    76.  
    77.     public void GameOver ()
    78.     {
    79.         gameOverText.text = "Game Over";
    80.         gameOver = true;
    81.     }
    82. }
    83.  
    84.  
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. [System.Serializable]
    5. public class Boundary
    6. {
    7.     public float xMin, xMax, zMin, zMax;
    8. }
    9.  
    10. public class PlayerControllerNew : MonoBehaviour
    11. {
    12.     private Rigidbody rb;
    13.  
    14.     void Start ()
    15.     {
    16.         rb = GetComponent<Rigidbody> ();
    17.     }
    18.  
    19.     public float speed;
    20.     public float tilt;
    21.     public Boundary boundary;
    22.  
    23.     public GameObject shot;
    24.     public Transform shotSpawn;
    25.     public float fireRate;
    26.  
    27.     private float nextFire;
    28.  
    29.  
    30.     void Update ()
    31.     {
    32.         if (Input.GetButton ("Fire1") && Time.time > nextFire)
    33.         {
    34.             nextFire = Time.time + fireRate;
    35.             //GameObject clone =
    36.             Instantiate(shot, shotSpawn.position, shotSpawn.rotation); //as GameObject;
    37.             AudioSource audio = GetComponent<AudioSource>();
    38.             audio.Play();
    39.         }
    40.     }
    41.     void FixedUpdate ()
    42.  
    43.     {
    44.     float moveHorizontal = Input.GetAxis ("Horizontal");
    45.     float moveVertical = Input.GetAxis ("Vertical");
    46.  
    47.     Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
    48.     rb.velocity = movement * speed;
    49.  
    50.         rb.position = new Vector3 (
    51.             Mathf.Clamp (rb.position.x, boundary.xMin, boundary.xMax),
    52.             0.0f,
    53.             Mathf.Clamp (rb.position.z, boundary.zMin, boundary.zMax)
    54.         );
    55.         rb.rotation = Quaternion.Euler (0.0f, 0.0f, rb.velocity.x * -tilt);
    56.     }
    57. }
    58.  
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class DestroyByContact : MonoBehaviour
    5. {
    6.     public GameObject explosion;
    7.     public GameObject playerExplosion;
    8.     public int scoreValue;
    9.     private GameController gameController;
    10.  
    11.     void Start ()
    12.     {
    13.         GameObject gameControllerObject = GameObject.FindWithTag ("GameController");
    14.         if (gameControllerObject != null)
    15.         {
    16.             gameController = gameControllerObject.GetComponent<GameController>();
    17.         }
    18.         if (gameControllerObject == null)
    19.         {
    20.             Debug.Log ("Cannot find 'GameController' script");
    21.         }
    22.     }
    23.  
    24.     void OnTriggerEnter(Collider other)
    25.     {
    26.         if (other.tag == "Boundary") {
    27.             return;
    28.         }
    29.         Instantiate(explosion, transform.position, transform.rotation);
    30.         if (other.tag == "Player");
    31.         {
    32.             Instantiate (playerExplosion, other.transform.position, other.transform.rotation);
    33.             gameController.GameOver ();
    34.         }
    35.         gameController.AddScore (scoreValue);
    36.         Destroy(other.gameObject);
    37.         Destroy(gameObject);
    38.     }
    39. }
     
    Last edited: Dec 12, 2016
  36. Muddasarmir

    Muddasarmir

    Joined:
    Nov 30, 2016
    Posts:
    2
    everything is going well with no errors till the last step and that is "Building the Game". i followed all the instructions in the tutorail but when i build the game my laptop get ShutDown(PowerOff). i restart my laptop many times but having same problem.
    can anyone help. please

    regards,
     
  37. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836

    Have you read through the Unity 5 Upgrade Guide on the space shooter tutorial page? might be some info there, I cant remember off the top of my head.
    https://unity3d.com/learn/tutorials/projects/space-shooter-tutorial
    or try changing the ambient source dropdown to solid color and make it black.
     
  38. Canabinoide-Games

    Canabinoide-Games

    Joined:
    Sep 19, 2015
    Posts:
    7
    On the asteroid section, 03.Explosions- the DestroyByContact script has "gameController.GameOver();" but we have not created the gameController script.. i think this is an error and this line should be removed as I don't see it in the video and i see next step is "Game Controller"?
     
  39. PanserKunst

    PanserKunst

    Joined:
    Dec 16, 2016
    Posts:
    1
    Space Shooter Unity 5.4.1

    Referenced update page for outdated video tutorial.

    "Adding hazards" step.

    All functions were working correctly at this point before starting this lesson. when "DestroyByContact" script was initiated bolt prefab(s) was / were stopped by the asteroid, but asteroid remained, also boundary was not destroying (instanced) bolt shots. Recommendations?
     
  40. Cleite

    Cleite

    Joined:
    Dec 17, 2016
    Posts:
    4
    I don't know whether this has been answered in this thread before or not, but I just finished watching the series, and I think I know why the enemy ships, in the improptu "make the enemy ships move towards the player" change, doesn't always move towards the player. Note that
    Code (csharp):
    1. targetManeuver
    is thought of as a velocity, while you feed it the sign of
    Code (csharp):
    1. playerTransform.position.x
    . That basically means that if the player is on the left half of the screen, the enemy ships will move towards the left edge of the screen. If you truly want the ships to maneuver towards the player, you would need to use the sign of
    Code (csharp):
    1. playerTransform.position.x - rb.position.x
    (or its negative, haven't thought this through thuroughly, and I didn't code along with the video so I can't test it). Of course, this would still not make the enemy ships "turn around" if you cross under them as they move, but ut will make their movement a lot more consistent.
     
  41. NatchDan

    NatchDan

    Joined:
    Dec 18, 2016
    Posts:
    2
    Hi folks,

    I'm working my way through this (great!) tutorial, but I've noticed that in 7. Shooting Shots, the documentation on Input.GetButton is wildly different to that in the video, and the upgrade document has no mention of this. The video doesn't look at deltaTime at all - could someone be so kind as to offer a little explanation as to the advantage of the newer method shown in the documentation against the method shown in the video, and a code example showing how the new code should look after applying this method?

    Many thanks!
     
  42. PhoenixFire360

    PhoenixFire360

    Joined:
    Dec 1, 2016
    Posts:
    1
    Hello, fellow users of the internet :)
    I keep having issues with the scripts and it is driving me crazy! I tried following what the tutorial says for increasing the player's ship's speed but each time I continue to get an error, at this point, I dropped the speed out of the current code but I am at my wit's end. at this point the deadline of this project is in 20 minutes and I know I won't finish this in time, but its been driving me insane enough to know i will never be able to rest unless i figure out how to code this whole project, not just this variable, but at least can someone help me out with this part first?

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class PlayerController : MonoBehaviour {
    5.  
    6.     private Rigidbody rb;
    7.     public float speed;
    8.     void Start ()
    9.     {
    10.         rb = GetComponent<Rigidbody>();
    11.     }
    12.     void FixedUpdate ()
    13.     {
    14.         float moveHorizontal = Input.GetAxis ("Horizontal");
    15.         float moveVertical = Input.GetAxis ("Vertical");
    16.  
    17.         Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
    18.  
    19.         rb.AddForce(movement);
    20.  
    21.  
     
  43. NatchDan

    NatchDan

    Joined:
    Dec 18, 2016
    Posts:
    2
    To my eye it looks like the issue is in the AddForce area, which is a) not used in the final version of the code the tutorial presents because you're not going for a physics-affected movement and b) not being affected by your new speed variable. Rather than using AddForce, consider :

    Code (CSharp):
    1. rb.velocity = movement * speed;
    Here you've got the "velocity" of the ship being defined as your "movement" multiplied by your new "speed" variable, which will then show in your inspector.

    Hopefully I've spotted the error there - I'm a newbie myself, so it's interesting to try and debug code!

    EDIT: Also, I don't see a closing curled bracket on the end there - I'm assuming that's just how you've copied and pasted it for the forum, but just in case!
     
  44. Choda-Boy

    Choda-Boy

    Joined:
    Sep 28, 2016
    Posts:
    7
    Hello, i am watching this tutorial, and I cannot set up the player settings in the way the tutorial does in the first video, in the build settings. I cannot set up the 600x960 width and height. Maybe is due to the changes between vers.4 and vers.5
    I am using the Unity 5 personal version.

    Can i do it other way?

    thanks
     
  45. MatthewShiers

    MatthewShiers

    Joined:
    Dec 22, 2016
    Posts:
    4
    I'm following along with the video tutorial (I know it's for version 4 of Unity and I'm on version 5.4.2), and at 5:16 on video 1, it talks about switching platforms from "Window/Mac/Linux" to "Web".

    The version of Unity I'm working on doesn't seem to have that platform available. What should I choose?
    I noticed "WebGL" was an option, but it requires me to download a module (the button is provided).

    It's worth mentioning that the Upgrade Guide for this tutorial project does not (at the time of writing this) list any known issues for this part of the project.
     
  46. Deleted User

    Deleted User

    Guest

    WebGL is the replacement for the Web player. This tutorial being about how to make a game playable on the web, it's the one you'll have to use. :)
     
  47. MatthewShiers

    MatthewShiers

    Joined:
    Dec 22, 2016
    Posts:
    4
    Thankyou AnneSchmidt
     
  48. igorkostan

    igorkostan

    Joined:
    Dec 24, 2016
    Posts:
    3
    Hi all.

    I just started with this project and I have a few questions regarding:

    A. "Setting up the project" video:

    1. According to the instructions I need to change target platform to the "Web Player". I'm using Unity v5.4 and there is no such thing in the "Platform" list. Because of that issue I decided to select "WebGL". Is that right thing to do ?

    2. Aspect Ratio in the GAME view. I changed default screen resolution BUT for some reason there was no changes in the GAME view (aspect ratio), according to the video tutorial this settings should be changed automatically. Therefore, I created my custom aspect ratio in order to obtain similar view with the tutorials. So my question is why aspect ration did not changed automatically after I changed default resolution ?

    3. Scene and Game view backgrounds in my Unity window are slightly different from those in the tutorial, is that OK or maybe something wrong with my settings ?

    B. "Camera and Lightening":

    1. How can I open "Render Settings" tab? According to video tutorials it suppose to be under EDIT menu, but in Unity v5.4 there is no such thing there...

    Thanks.
     
    Last edited: Dec 24, 2016
  49. CarlJFoster

    CarlJFoster

    Joined:
    Dec 26, 2016
    Posts:
    5
    Hi All

    I'm having a problem with the "Shooting Shots" part of the tutorial. After completing the code to fire the shots, I can get the ship to fire the shots, but only when the ship is not moving. As soon as the ship starts moving then the ship cannot start firing.

    If I fire BEFORE moving it works and will continue firing after moving if the mouse button is held down, but if I release the mouse button and try firing again while moving then it doesn't fire. I have to stop the ship to start firing.

    Any ideas on what this might be as I've had this problem on another tutorial and just can't seem to solve it?

    Thanks all.
     
  50. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    Any chance you can copy your PlayerController script in please Carl just out of curiosity, sounds like you make have nested statements.