Search Unity

Space Shooter Tutorial Q&A

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

  1. Eraggom

    Eraggom

    Joined:
    Aug 1, 2015
    Posts:
    1
    my space ship is moving correctly but when i releases the arrow key it move back to its starting point automatically..... how do i fix it?

    I m using Unity 5....
     
    Last edited: Aug 1, 2015
  2. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    No worries @Zouron thats what the forums here for, help each other out,

    After you have ran through this tutorial series, you have a pretty decent core of a game and understanding of functionaliy and logic. The enemies etc and primarily there for what Adam put in as 'Stretch Goals'. the premise behind that is you have the basic tools and understanding from going through the series, and now its over to you to try and 'salt to taste' and tweak and add more stuff to your game as you would like to further your learning.

    As a guide and reference to help on your way, if you have downloaded the Space Shooter asset pack from the Asset Store, you will see a 'Done' folder in your project folder tab, in there you have loads of other scripts etc for enemies that you can dissect and learn from to try and incorporate yourself. (or have a look at the done scene to see enemies in action)

    and above all, there is this forum to help out with scripting/physics etc, and there are sections that you can post in that most folk on here would be more than glad to help you out.

    anyhoo, war and peace over, happy learning :)
     
  3. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    You will find this in the "done" folder. You should be able to follow what was done in that package and then work from there.
     
  4. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    I should read ahead before answering! Thanks Obo! (^_^)!
     
    OboShape likes this.
  5. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    I would suggest that you go back and check your player controller code and make sure it matches the tutorial. You can find the final scripts on the page where the tutorial is embedded.
     
  6. Zouron

    Zouron

    Joined:
    Jul 27, 2015
    Posts:
    6
    Thanks guys, i thought that was the case.

    I am making a similar game for my University project, and am going to implement some "terrain" from both sides for the player to avoid, along with more enemy ships. For adding the terrain i am thinking of making the entire scene (haven't thought about length yet) and moving it towards the player. Would you guys suggest any other method?
     
  7. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    If you are going to create a "scene", I'd suggest making the scene static and moving the ship, locking the camera to the ship.
     
  8. caininus

    caininus

    Joined:
    Aug 1, 2015
    Posts:
    1
    I am stuck at the Player Movement section. I have made my script for movement, made the changes for 5.0, and when I go to playtest the scene the player doesn't move. There are no errors with the script, at least none that are showing on the console. I checked my code against the one found in the done file and it should work. I actually replaced my script with the one from the done file, and it still doesn't move. Frustrated I started another project, the Survival Shooter tutorial, and have the exact same problem in that as well. I have checked the input manager and everything is still at default so I don't think anything has changed there, and since it is a recurring problem I don't think it is a coding issue. I have already done the Roll-a-Ball tutorial and that worked fine.

    Any suggestions as to the problem?

    Thanks in advance.

    Edit: I managed to fix the Survival Shooter Movement (misspelled command that wasn't showing as an error on the console). The Space Shooter movement issue is still present.

    Second Edit: It turns out that my script was good, but I had neglected to set a speed in the code itself and never set it in Unity itself. The problem has now been resolved (for now).
     
    Last edited: Aug 3, 2015
  9. Zouron

    Zouron

    Joined:
    Jul 27, 2015
    Posts:
    6
    Doing it that way, would i still be able to limit camera movement to the X-axis? By locking the camera to the ship wouldn't the camera move when the player moves left and right?

    Another idea i had was to use gravity and that take care of scene and enemy movement for me. I haven't tried this out yet, but intend to start soon.
     
  10. _GRMaverick

    _GRMaverick

    Joined:
    Aug 2, 2015
    Posts:
    2
    Hello folks,
    I'm currently running through this tutorial and I keep getting a NullReferenceException at "GetComponent<Rigidbody>().position = new Vector3...." when trying to create boundaries at the side of the gamezone.

    Code (CSharp):
    1. public class PlayerController : MonoBehaviour
    2.  
    3. {    public float speed;
    4.     public Boundary boundary;
    5.  
    6.     void FixedUpdate()
    7.     {
    8.         float moveHorizontal = Input.GetAxis ("Horizontal");
    9.         float moveVertical = Input.GetAxis ("Vertical");
    10.         Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
    11.  
    12.         GetComponent<Rigidbody>().velocity = movement * speed;
    13.         GetComponent<Rigidbody>().position = new Vector3 (
    14.             Mathf.Clamp (GetComponent<Rigidbody>().position.x, boundary.xMin, boundary.xMax),
    15.             0.0f,
    16.             Mathf.Clamp (GetComponent<Rigidbody>().position.z, boundary.zMin, boundary.zMax));
    17.     }
    18. }
    Through my (limited) past experience with C# and C++, I suspect I know what is wrong. I'm just not so sure I know why it is wrong. I'm trying to call a variable of a object that hasn't been instantiated, except I thought the component would be instantiated?

    _GRMaverick
     
  11. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    If you have a large amount of geometry with colliders, it's best to not move it if you don't have to. You will also be able to avoid having a rigidbody on that geometry. You can set the position of the camera only on the z axis to the ship and leave the x axis at 0.
     
  12. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Yay! Glad you got it working.
     
  13. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    So, you're getting a null reference exception on line 13 (position) but not line 12 (velocity)? Or both? What about lines 14 & 16?
     
  14. Deleted User

    Deleted User

    Guest

    You just for got to capitalize Start ()
     
  15. _GRMaverick

    _GRMaverick

    Joined:
    Aug 2, 2015
    Posts:
    2
    Seems to just be line 14, for .position
     
  16. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    You can try to follow the upgrade guide in the OP and cache the reference to the rigidbody and use the reference, and see if this helps.

    It's better code.

     
  17. Zouron

    Zouron

    Joined:
    Jul 27, 2015
    Posts:
    6
    Hey guys, i was taking a look at the BGScroller script and trying to figure out how it works.

    From my understanding of whats in the code...

    We are changing the position of the background each time Update is called. this new position becomes the start position + new position. The new position is calculate with the Repeat, where we multiply time with our specified scroll speed and move it by the size of our background size.

    Did i get that right? please correct me if not. Now what i don't understand is why are we multiplying it by Vector3.forward, i don't understand what that is and what value would you get from it.
     
  18. Ezekiel322

    Ezekiel322

    Joined:
    Aug 5, 2015
    Posts:
    2
    Hey,

    I have finished lesson 13 and for some reason the audio doesn't play on my computer. I have changed the syntax in PlayerController script to be
    Code (CSharp):
    1. GetComponent<AudioSource>().Play();
    and things run but the audio just won't play..
    It should also be mentioned that when I try to play the sound in the preview window of the audio file it doesn't work, though when I press open, the vlc media player opens and plays the sound. See attached photo.
    I am using Unity 5.1.2f1 with Windows 8.1.

    Thank you!
     

    Attached Files:

  19. Ezekiel322

    Ezekiel322

    Joined:
    Aug 5, 2015
    Posts:
    2
    Update:
    I finished the tutorial, built and ran the game and the music is on when I run the game in a web browser.
     
  20. fedeberg

    fedeberg

    Joined:
    Aug 7, 2015
    Posts:
    2
    EDIT: Solved! My Start method was written with a lowercase s. That's important!
    Hi, I'm watching this tutorial. I know nothing about C#.
    I have a problem in lesson 14 "Counting Points":
    This is my DestroybyContact script:


    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 (gameController == null)
    19.         {
    20.             Debug.Log ("Cannot find 'GameController' script");
    21.         }
    22.     }
    23.  
    24.     void OnTriggerEnter (Collider other) {
    25.         if (other.tag == "Boundary")
    26.         {
    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.         }
    34.  
    35.         gameController.AddScore(scoreValue);
    36.  
    37.         Destroy(other.gameObject);
    38.         Destroy (gameObject);
    39.     }
    40. }
    When I run my game, everything runs ok until a bolt touches an asteroid. The explosion appears but the asteroid remains and I get this error on the console:

    Line 35 is
    gameController.AddScore(scoreValue);

    It seems that gameController remains unset even after Start
    Please help!
     
    Last edited: Aug 7, 2015
  21. wang2123125

    wang2123125

    Joined:
    Aug 7, 2015
    Posts:
    4
    Non-convex MeshColliders with non-kinematic Rigidbodies are no longer supported in Unity 5.0.
    这样做的原因是,我没加MESH BUG呢?
    您将重新创建5.0版的太空射击游戏教程?
     
  22. wang2123125

    wang2123125

    Joined:
    Aug 7, 2015
    Posts:
    4
    你好我的陨石之间的边界将被自动销毁,陨石后的残骸的边框将消失,请问这是为什么?
    [代码= CSHARP]使用UnityEngine;
    System.Collections中使用;

    公共类DestoryByBoundary:MonoBehaviour
    {

    无效OnTriggerExit(对撞机等)
    {

    销毁(other.gameObject);

    }

    } [/代码]
    Code (CSharp):
    1.     void Update () {
    2.    
    3.     }
    4.     public void DoOnTriggerEnter(Collider other)
    5.     {
    6.         if (other.tag == "Boundary" || other.tag == "Enemy")
    7.          {
    8.             return;
    9.          }
    10.         if (explosion != null)
    11.         {
    12.             Instantiate(explosion, transform.position,transform.rotation);
    13.         }
    14.  
    15.         if (other.tag == "Player")
    16.         {
    17.             Instantiate(playerExplosion, other.transform.position, other.transform.rotation);
    18.         }
    19.      
    20.         Destroy(other.gameObject);
    21.         Destroy(this.gameObject);
    22.  
    23.     }
    24. }
    25.  
     
  23. Dackten

    Dackten

    Joined:
    May 11, 2015
    Posts:
    4
    EDIT : Resolved! I had a destroy script attached to the wrong object. (also transform.up was corrected to transform.forward but that didn't fix the problem)

    Hi all and advanced thanks for any help!
    I'm having trouble making my first asteroid move down the screen. Upon hitting play (with Mover script speed at -5) it almost immediately disappears. Speed set to -1 it takes longer to disappear but does none the less. Bolts move up the screen with no issue so the Mover script must be ok. Boundary isn't disappearing along with the asteroid, so thats setup ok. The latest code written was the player explosion (within DestroyByContact), which also works fine assuming I move the player up into the asteroid. Following that I simply dragged my Mover script into the Parent Asteroid's Inspector and set speed to -5. Seems to be exactly as the tutorial advised but I'm sure I'm overlooking something in my newbiness!

    Any thoughts welcome! Thanks for existing you beautiful people!

    MOVER

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class Mover : MonoBehaviour
    5. {
    6.     public float speed;
    7.  
    8.     void Start ()
    9.     {
    10.         GetComponent<Rigidbody>().velocity = transform.up * speed;
    11.     }
    12. }
    DESTROYBYCONTACT

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class DestroyByContact : MonoBehaviour
    5. {
    6.  
    7.     public GameObject explosion;
    8.     public GameObject playerExplosion;
    9.  
    10.     void OnTriggerEnter(Collider other) {
    11.         if (other.tag == "Boundary")
    12.         {
    13.             return;
    14.         }
    15.         Instantiate (explosion, transform.position, transform.rotation);
    16.         if (other.tag == "Player") {  
    17.             Instantiate (playerExplosion, other.transform.position, other.transform.rotation);
    18.         }
    19.         Destroy(other.gameObject);
    20.         Destroy (gameObject);
    21.     }
    22. }
     
    Last edited: Aug 9, 2015
  24. matthewse19

    matthewse19

    Joined:
    Aug 9, 2015
    Posts:
    3
    After watching creating shots and doing getting to the very last step, I am not able to make my bolt move forward. This is my code:

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class Mover : MonoBehaviour
    5. {
    6.     public float speed;
    7.  
    8.     void Start ()
    9.     {
    10.           GetComponent<Rigidbody>().velocity = movement * speed;
    11.     }
    12. }
    13.  
    14.  
    15.  
     
  25. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    Afternoon @matthewse19. you have not declared your variable called 'movement' and will have a value of 0, and therefore your velocity will be 0.

    if you look at the script that Adam has done for the Mover script, this line should read.
    Code (CSharp):
    1.        
    2. GetComponent<Rigidbody>().velocity = transform.forward * speed;
    3.  
    as this will use the preset vector of transform.forward (which is 1 in the Z direction i believe) and then multiply it by speed, remembering to set your speed in the inspector too ;)
     
  26. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    Vector3.forward is a preset value and has the Vector3 value of (0,0,1), just looks a bit easier to type and read.
    have a little look at the docs
    http://docs.unity3d.com/ScriptReference/Vector3-forward.html

    so i this context the time.deltatime is the time taken between update calls, and if you multiply this by the speed value and then by the Vector3.forward value, this will move the background in the Z direction a distance relative to your set speed value and in proportion to the time taken between update calls. just so that if there is (and there will be) slight differences in the time between update calls, the movement will be smooth. hope that helps a little.
     
  27. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    You have set the tag in the editor using the same CaSe and spelling as you have in your script ?
     
  28. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    Afternoon, firstly your line 4 should read
    Code (CSharp):
    1. void OnTriggerEnter(Collider other)
    as DoOnTriggerEnter() wont work.

    I cant really tell other than that what the question is, I can only guess. If possible when posting can you post in English to allow others to read and help.

    Cheers
    ObO
     
  29. Dackten

    Dackten

    Joined:
    May 11, 2015
    Posts:
    4
    Having a little trouble tying up the end of this tut. "Game Over" and "R to restart" (pressing R also does nothing) don't appear after player death. I've gone over the video twice with no luck finding the issue. "Score Text, Restart Text and Game Over Text" have all been loaded into the correct place on "Game Controllers" inspector. Any clues?

    GAME CONTROLLER

    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 = "Press 'R' for Restart";
    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. }
    DESTROY BY CONTACT

    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 (gameController == null)
    19.         {
    20.             Debug.Log ("Cannot find 'GameController' script");
    21.         }
    22.     }
    23.  
    24.     void OnTriggerEnter(Collider other)
    25.     {
    26.         if (other.tag == "Boundary")
    27.         {
    28.             return;
    29.         }
    30.         Instantiate(explosion, transform.position, transform.rotation);
    31.         if (other.tag == "Player")
    32.         {
    33.             Instantiate(playerExplosion, other.transform.position, other.transform.rotation);
    34.             gameController.GameOver ();
    35.         }
    36.         gameController.AddScore (scoreValue);
    37.         Destroy(other.gameObject);
    38.         Destroy(gameObject);
    39.     }
    40. }
     
  30. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    @Dackten, evening,

    Just wondering is your score visible ok on screen and does it update correctly?
    Is your restart text and game over text visible in the editor when you check in the game window?

    Just while im having a read through.

    just for testing can you put a quick debug line in your GameOver method please, just to see if its getting called when you die, see if its getting that far.
    Code (CSharp):
    1. public void GameOver ()
    2. {
    3.     debug.log("Game Over function called");  // just for testing to console.
    4.     gameOverText.text = "Game Over!";
    5.     gameOver = true;
    6. }
     
    Dackten likes this.
  31. Dackten

    Dackten

    Joined:
    May 11, 2015
    Posts:
    4
    I added Debug.Log("Game Over function called"); to that part of the script but got no feedback from the console. Also yes the score text and count is working fine.

     
  32. Dackten

    Dackten

    Joined:
    May 11, 2015
    Posts:
    4
    I got it figured! With no debug log returning I assumed the problem must be with "Destroy by contact" calling the gameover code. When I looked deeper into it the Player hadn't been Tagged as "Player". So I actually wasn't getting the player death animation either. I hadn't noticed since the asteroid explosion plays fine. Thanks for your help! getting to the bottom of it myself = satisfaction! :D

     
    OboShape likes this.
  33. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    Pipped at the post, was the next thing to check, nice one :)
     
    Dackten likes this.
  34. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Vector3.forward is the direction of travel in 3d space. It is the equivalent of Vector3 (0, 0, 1) which, when multiplied by, for example, 5 - becomes Vector3 (0, 0, 5).
     
  35. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    I am on holidays until the 10th of September, with limited access to the Internet, so expect delays in my responses.
     
  36. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Can you please try google translate or other translation software and post in English? We do not currently support your language.
     
  37. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Can you please try google translate or other translation software and post in English? We do not currently support your language.
     
  38. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
  39. DannyK89

    DannyK89

    Joined:
    Aug 12, 2015
    Posts:
    9
    Hi everyone,

    I'm pretty new and just started learning Unity. I started working on the space shooter tutorial to try to learn. I ran into an issue trying to get the space ship to shoot. For some reason when I press the space bar my ship does not fire a bolt like in the tutorial. I tried to do some research on the forums but I couldn't find anything. Hopefully someone can point me in the right direction. I am using Unity 5. I will upload the player controller that I have so far. If you see anything wrong let me know.

    Thanks,
    Dan
     

    Attached Files:

  40. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    Morning @DannyK89,

    Looking at your PlayerController script,

    where you have
    Code (CSharp):
    1.     void update(){
    on line 24, this should be changed to
    Code (CSharp):
    1.     void Update(){
    as the U should be upper case, or this method wont get called and wont throw an error either.
    try that to begin with.
    ObO
     
  41. TulioAdriano

    TulioAdriano

    Joined:
    Aug 12, 2015
    Posts:
    2
    First of all, thank you for the tutorial, and even more so for still being here and answering questions from everyone. This is premium customer care! Amazing!

    I've been designing games for Mega Drive for a long time and learning modern game design through unity. This tutorial came just right up my alley since it's 2D view but still 3D internally, so I learned a lot through it.

    Now I'd like to go the next step and do the next tutorial that makes the enemies and scrolling background.

    I looked around the tutorials page but I can't find it easily. Anyone has a link to the official tutorial?

    Thank you.
     
  42. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    Hi @TulioAdriano,
    The enemy ships and scripts etc were put in by Adam as 'Stretch Goals' and as such do not have any further official tutorials associated with them, the source you will find in the Done folder within your project hierarchy. the majority (if not all) of the core mechanics and scripting concepts you will have covered within the tutorial up to the completion stage.
    but if there are any specifics in the scripts that you need to look up, dont forget the online scripting reference and manual
    http://docs.unity3d.com/ScriptReference/index.html
    or theres the tutorial repo here
    http://unity3d.com/learn/tutorials

    I've not really delved too deep into them in a while, however if you have a specific question once you have had a look around at them and tried to figure them out yourself, pop a question up :)

    for further reading on scrolling backgrounds, you can always have a look at the Live training archived session that Adam did, although not directly related to this tutorial series, the session content is enlightening all the same :)
    http://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/2d-scrolling-backgrounds

    have a look through the other archives sessions as they are brill source of info ;)
     
  43. TulioAdriano

    TulioAdriano

    Joined:
    Aug 12, 2015
    Posts:
    2
    Well since it isn't there, it's ok, it will be a good exercise to figure it out on my own. I wanted to follow the full tutorial and start doing my own "start from zero" project afterwards, but this will do anyway.

    Thank you for such a prompt answer!
     
  44. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    any questions just shout tho, this forums brilliant for getting back to you with info, and im sure that someone from Unity will be watching over here while Adam is on hols ;)
     
  45. DannyK89

    DannyK89

    Joined:
    Aug 12, 2015
    Posts:
    9
    Thanks! Once I made that fix it worked just fine. I must have been tired and not noticed that that was the issue.

    Thanks,
    Danny
     
  46. Doamia1980

    Doamia1980

    Joined:
    Aug 13, 2015
    Posts:
    2
    I'm in the same boat as Tulio and have just finished up the tutorial. I've been using C# for business applications for a while but am a gamer at heart. Unity has been awesome so far. Going to try to complete the game with enemies and report back here.
     
  47. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Yes, the enemies and a few other items are "stretch goals" for the user to have fun with.

    There is a "done" folder in the project which can be analysed and dissected.
     
  48. GregMeach

    GregMeach

    Joined:
    Dec 5, 2012
    Posts:
    249
    The most recent (v1.1??) store update won't stay updated. Looks to me like the version was reset to 1.0 instead of 1.1 or 1.2.

    OT: Thanks to everyone on the Learning Team, great stuff!
     
  49. Doamia1980

    Doamia1980

    Joined:
    Aug 13, 2015
    Posts:
    2
    I working on the done folder and would like some advice. I'd like to keep track of the time between kills and play a different sound if you are killing enemies quickly. Can you tell me where to put my audio clip, the best way to keep track of time between kills, and how to play the new audio when needed? I'm loving this game!!! Thanks in advance.
     
  50. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    afternoon @Doamia1980,

    as this is really above what the tutorial encompasses, I have sent you a wee PM with what i tried out this morning, to try and help along a bit.

    But that said, there are tutorials and live training archives that can give a good source of info.

    Matt's SFX and Scripting - http://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/sound-effects-scripting
    where he uses different audio clips in different scenarios through scripting.

    You've already used something that's handy during the course of this tutorial, the 'Time' class.
    and when shooting the player bolts, you checked to see if a certain time has elapsed.
    use a similar principle and record and compare two float values that you can create for lastKill and currentKill for instance, and set and compare these when something is killed.


    Ive Pm'd a little portion of a script to you that I had a play with this morning.
    ObO
     
    Last edited: Aug 14, 2015