Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Space Shooter Tutorial Q&A

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

  1. The-Animus

    The-Animus

    Joined:
    May 28, 2017
    Posts:
    15
    Thanks for the response gwnguy! So I did literally nothing to the game since I posted that yesterday. But now when I launch Unity and open the project all the errors are gone.

    The gameobject is indeed tagged "Player" and I pasted the debug code like you suggested but it did not trigger a debug log message so it seems to be finding the player now.

    This isn't the first time I've encountered error messages or game mechanics performing differently than they should, only to have it resolve itself without actually changing anything simply by reloading Unity or by copying the code that was already there and just pasting it over itself.

    So I'm not sure if there is some other explanation I'm not aware of, or if Unity just flips out on occasion but I guess I should just be happy the errors disappeared.
     
  2. The-Animus

    The-Animus

    Joined:
    May 28, 2017
    Posts:
    15
    Hey drezzatl,

    Just an FYI for future posts, put your code between the tags [ code] and [ /code] but without the space to post it in code format.

    Two things I can see that might be causing the lack of movement.

    1. Not sure if it's a copy pasting error when you pasted your code but it looks like you are missing a ending } bracket to close out the public class PlayerController : MonoBehaviour
    {

    2. It looks like you didn't update your code to account for some of the changes in how things work in Unity 5 vs the older Unity 4 for which the tutorial was originally made. On the page where you are following the video tutorial, if you look a little down the page you will see "Get the Upgrade Guide for Unity 5 here." Page 14 of that deals with the "Moving the Player" section and the changes that need to be made. I think you had to make this same type of change in a previous tutorial but I can't remember for sure.

    Basically you need the following

    Create a variable (the name rb is generally used in the tutorials)
    Code (csharp):
    1. private Rigidbody rb;
    In your
    Code (csharp):
    1. void Start ()
    2. {
    you need to add
    Code (csharp):
    1. rb = GetComponent<Rigidbody>();
    and then one of the lines in your

    Code (csharp):
    1.  void FixedUpdate ()
    2. {
    would be
    Code (csharp):
    1. rb.velocity = movement;
    Good luck!
     
  3. Khanadian

    Khanadian

    Joined:
    Jun 1, 2017
    Posts:
    2
    I know the videos are a little outdated, but should my unity look like the one in the video? when I set the resolution nothing changes on my screen, and I don't have a 'web' aspect ratio (these are all things around the 6 minute mark of the first video)
     
    Last edited: Jun 22, 2017
  4. The-Animus

    The-Animus

    Joined:
    May 28, 2017
    Posts:
    15
    Edited - Nevermind, I'm dumb :p. Finally figured out that the error only shows up if you test play the game and the player runs out of lives and there is an enemy ship still on screen because the enemy ship tries to do an evasive maneuver towards the player gameobject which no longer exists.
     
    Last edited: Jun 23, 2017
  5. AsterineSea

    AsterineSea

    Joined:
    May 17, 2017
    Posts:
    2
    Good afternoon! Thank you for the great tutorial. I'm enjoying the series immensely.

    I am stuck presently, though, on the Boundary portion. This is such a simple thing, but I've tried quite a few fixes and nothing seems to work. The Bolts are not being destroyed when they leave the Boundary. Or they are only partially being destroyed? I can no longer access the drop-down menu for the Bolts in the Hierarchy once they have passed through the Boundary, but they do still exist and travel endlessly on the Z-axis.

    This code is copied from the documentation. I don't know if it's significant, but the Data Type "Collider" is not highlighted like other Data Types in VS (2015). Is there somewhere else I can look for an issue?

    Code (csharp):
    1.  
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using UnityEngine;
    5.  
    6. public class DestroyByBoundary : MonoBehaviour
    7. {
    8.    void OnTriggerExit(Collider other)
    9.    {
    10.        // Destroy everything that leaves the trigger
    11.        Destroy(other.gameObject);
    12.    }
    13. }
    14.  
     
  6. gwnguy

    gwnguy

    Joined:
    Apr 25, 2017
    Posts:
    144
    It's been a long time since I took this tutorial. My script looks different than yours, but perhaps the changes are cooked in at a later episode. Here's how my script looks:
    Code (csharp):
    1.  
    2.     void OnTriggerExit(Collider other)
    3.     {
    4.         if (other.transform.parent == null)
    5.         {
    6.             Object.Destroy(other.gameObject);
    7.         }
    8.         else
    9.         {
    10.             Object.Destroy(other.transform.parent.gameObject);
    11.         }
    12.     }
    13.  
    The project hierarchy for the bolt:
    upload_2017-6-23_14-0-0.png

    The wiring of the bolt:
    upload_2017-6-23_14-2-51.png

    The wiring of the Vfx child of the bolt:
    upload_2017-6-23_14-2-20.png
     

    Attached Files:

    AsterineSea likes this.
  7. AsterineSea

    AsterineSea

    Joined:
    May 17, 2017
    Posts:
    2
    Thank you! Somehow the capsule collider was applied to the VFX instead of the Bolt Prefab. I didn't think to look at that.

    Applying the collider to the proper place has fixed my issue. I appreciate your time!
     
  8. joecole22

    joecole22

    Joined:
    Nov 25, 2016
    Posts:
    1
    Is there any solution in the PlayerController code for Space Shooter Tutorial, I'm using Unity 5.5.1...?
    Thanks In Advance.
     
  9. startibor

    startibor

    Joined:
    Jun 24, 2017
    Posts:
    1
    Hi,

    This solution did not worked for me as I wanted. All 3 bolt was fired stright forward.
    My solution is for ignoring the player ship's rotation when shooting is:

    foreach(var shotSpawn in shotSpawns) {
    Instantiate (shot, shotSpawn.position, shotSpawn.localRotation);
    }

    So the bolts are going to the right directions as I set it originally in Unity.
     
  10. Lord_Munster

    Lord_Munster

    Joined:
    Feb 21, 2017
    Posts:
    2
    Hi neewbie here,

    I passed trought the "Counting points and displaying the score" tutorial and everything was fine until the end. I can't drag'n drop the GUItext in the Game Controllers' inspector.


    upload_2017-6-25_11-22-41.png

    In fact, i'm using Unity 5.6.1f1 and the GUItext not working the same way than the tutorial, and I can't find anything about this. I've pass trought everything a few time allready, after all that I copied and paste all the script for be sure all was fine but.... I'm not good coder (more artistic) and I don't see how patch that.

    When I start the game, it go straight on pause. Than i push PLAY and it's work but no astroid are create. The console error message says:

    upload_2017-6-25_11-31-10.png

    So... i'm understand the need to assign but I can't !!!!

    Little help please? Thanks
     
    BurzumStride likes this.
  11. gwnguy

    gwnguy

    Joined:
    Apr 25, 2017
    Posts:
    144
    It is possible to confuse regular text and GUI text.

    In your GameController, confirm you have

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.UI; // <--- need this for GUI text
    using UnityEngine.SceneManagement;



    and confirm your variables are GUIText:
    public GUIText scoreText;
    public GUIText restartText;
    public GUIText gameOverText;



    AND, make sure your score text in Unity IS in fact GUI text and not regular text.
    (I kind of suspect this is the case)
    upload_2017-6-25_14-10-43.png


    Now, I'm kinda running from memory here....
    I think you insert GUI text from Component-->Rendering-->GUI Text
    upload_2017-6-25_14-16-8.png

    Good luck!
     
    BurzumStride likes this.
  12. Lord_Munster

    Lord_Munster

    Joined:
    Feb 21, 2017
    Posts:
    2
    HHoooo yessss, thank you very much gwnguy. That's work now! May be a little up-date in the manual will help for sure, but with help like yours, it's good (and really appreciated).

    I just need now to figure why the point not raising but i'll redo all one more time for find it.

    Thanks again!
     
  13. Seif

    Seif

    Joined:
    Aug 18, 2015
    Posts:
    9
    hi i almost finish the last episode in thee tutorial which is the converting of the Game to mobile platforms ... well . i am stuck at the touch pad script for some reason i can't use IpointerDown,Up i really don't see why .. but i have this error: `SimplePadTouch' does not implement interface member i have checked that i am using the UI and Eventsystem 100 Times .. but still please can u give me any solution to that ?
     
  14. Glithero

    Glithero

    Joined:
    Jun 27, 2017
    Posts:
    1
    Hi, I'm just getting started with this Space Shooter tutorial on Unity 5.5. I don't have Web Player in the build platforms but tere is WebGL. Will this work?
     
  15. CatLover00

    CatLover00

    Joined:
    Jun 27, 2017
    Posts:
    2
    Hi i finished making bolts and to shoot bolts. But there is one problem.

    I set the value of tilt to 10, and the bolt just tilts with ship and it gets narrower than usual.

    It is not really recognizable when you set tilt under 5, but if it goes to 10 you can really know that the laser is tilting with ship. So I want to make bolt not tilt with the ship, and I can't figure out how to do it.

    The ShotSpawn is child of PlayerShip, so if the ship tilts ShotSpawn tilts. And bolt is triggered from ShotSpawn so if ShotSpawn is tilted bolt is also tilted.

    Do you guys have any ideas?
     
  16. kajes

    kajes

    Joined:
    Jun 25, 2017
    Posts:
    6
    You can set the rotation of the shotSpawn object in the same way as you set the rotation on the ship, except that you set all the axis values to 0.

    Example:
    Code (CSharp):
    1. shotSpawn.rotation = Quaternion.Euler(0f, 0f, 0f);
     
    CatLover00 likes this.
  17. CatLover00

    CatLover00

    Joined:
    Jun 27, 2017
    Posts:
    2
    WoW! A big thanks to you! it really worked well. Thank you again for your reply.
     
    kajes likes this.
  18. Seif

    Seif

    Joined:
    Aug 18, 2015
    Posts:
    9
    sorry for repeating this but i have been stuck in this part for 3 days so far .. please anyone know ?
     
  19. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    Morning @Seif
    Can you pop in a copy of your SimpleTouchPad script please ( or the script that is not working for you), so we can have a look, using code tags as well please, just to make it easier to read on here.
     
    Seif likes this.
  20. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    Yep, definitely, the WebPlayer has been deprectated, and changing your build target to WebGL will effectively give you the same output, so you can pop on a web page.
     
  21. Seif

    Seif

    Joined:
    Aug 18, 2015
    Posts:
    9
    My script is exactly like the on in unity's tutorial reference ... but i can assure u that the error isn't in the script it's self as i deleted everything in the script except the following line .. which the error is at ..

    i am using Unity's UI and eventsystems i don't seem to see any problem Dk why am i having error !
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.UI;
    5. using UnityEngine.EventSystems;
    6.  
    7. public class SimpleTouchPad : MonoBehaviour,IPointerUpHandler,IPointerDownHandler {
    and i get those errors .. (which is the same error but one for the ipointer up and the other is for the ipointer down)

    Assets/Pad/SimpleTouchPad.cs(7,14): error CS0535: `SimpleTouchPad' does not implement interface member `UnityEngine.EventSystems.IPointerUpHandler.OnPointerUp(UnityEngine.EventSystems.PointerEventData)'

    Assets/Pad/SimpleTouchPad.cs(7,14): error CS0535: `SimpleTouchPad' does not implement interface member `UnityEngine.EventSystems.IPointerDownHandler.OnPointerDown(UnityEngine.EventSystems.PointerEventData)'

    sorry for the delay .. just had some internet problems
     
  22. gwnguy

    gwnguy

    Joined:
    Apr 25, 2017
    Posts:
    144
    Seif, I don't know if this helps or not, I tried the following code:
    Code (csharp):
    1.  
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using UnityEngine;
    5. using UnityEngine.UI;
    6. using UnityEngine.EventSystems;
    7.  
    8. public class SimpleTouchPad : MonoBehaviour, IPointerUpHandler, IPointerDownHandler
    9. {
    10.     public virtual void OnPointerDown(PointerEventData ped)
    11.     {
    12.  
    13.     }
    14.  
    15.     public virtual void OnPointerUp(PointerEventData ped)
    16.     {
    17.  
    18.     }
    19. }
    20.  
    and it built without error. Sorry, but I don't actually use the touchpad so I can't go do anything more.

    Perhaps your method names are an issue?

    (See link: https://forum.unity3d.com/threads/does-not-implement-interface-member.382709/)
     
    OboShape likes this.
  23. Seif

    Seif

    Joined:
    Aug 18, 2015
    Posts:
    9
    we
    well i used the same code that u just wrote and still the error pops up ... so i tried reinstalling unity and it worked .. even some of my blender files that weren't working just worked fine :D

    that made me want to asf weather 5.6.1f1 is stable or not ?
     
    OboShape likes this.
  24. nguyenthanhliemfc

    nguyenthanhliemfc

    Joined:
    Dec 28, 2016
    Posts:
    21
    In Boundary video, Why my bolt is destroy immediately after create?
     
  25. Seif

    Seif

    Joined:
    Aug 18, 2015
    Posts:
    9
    can u give me some more info so that i can help you ? :) script and a picture of ur bolt's Components
     
  26. troile696

    troile696

    Joined:
    May 28, 2017
    Posts:
    2
    I'm in final part of the tutorial, but I cant proceed because of this error:
    Assets/Scripts/GameController.cs(60,17): error CS0428: Cannot convert method group `gameOver' to non-delegate type `bool'. Consider using parentheses to invoke the method

    This is my script:
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.SceneManagement;

    public class GameController : MonoBehaviour {

    public GameObject hazard;
    public Vector3 spawnValues;
    public int hazardCount;
    public float spawnWait;
    public float startWait;
    public float waveWait;

    public GUIText scoreText;
    public GUIText restartText;
    public GUIText gameOverText;

    private bool gameoverB;
    private bool restart;
    private int score;

    void Start()
    {
    gameoverB = false;
    restart = false;
    restartText.text = "";
    gameOverText.text = "";
    score = 0;
    UpdateScore();
    StartCoroutine(SpawnWaves());
    }

    void Update()
    {
    if (restart)
    {
    if (Input.GetKeyDown(KeyCode.R))
    {

    SceneManager.LoadScene (SceneManager.GetActiveScene().buildIndex);
    }
    }
    }

    IEnumerator SpawnWaves()
    {
    yield return new WaitForSeconds(startWait);
    while (true)
    {
    for (int i = 0; i < hazardCount; i++)
    {
    Vector3 spawnPosition = new Vector3(Random.Range(-spawnValues.x, spawnValues.x), spawnValues.y, spawnValues.z);
    Quaternion spawnRotation = Quaternion.identity;
    Instantiate(hazard, spawnPosition, spawnRotation);
    yield return new WaitForSeconds(spawnWait);
    }
    yield return new WaitForSeconds(waveWait);

    if (gameOver)
    {
    restartText.text = "Press 'R' for Restart";
    restart = true;
    break;
    }
    }
    }

    public void AddScore (int newScoreValue)
    {
    score += newScoreValue;
    UpdateScore();
    }

    public void gameOver()
    {
    gameOverText.text = "Game Over!";
    gameoverB = true;
    }

    void UpdateScore()
    {
    scoreText.text = "Score: " + score;
    }
    }


    I don't know why my "if (gameOver)" cannot be invoked. If I use () (if (gameOver()) ) I got the error Cannot implicity convert type 'void' to bool. So... Im really confused.
    What I need to do now?
     
  27. gwnguy

    gwnguy

    Joined:
    Apr 25, 2017
    Posts:
    144
    It would help (be much more readable and it gives us line numbers to refer to) if you wrapped your code in code blocks.

    You have a boolean defined:
    Code (csharp):
    1. private bool gameoverB;
    in Start, you set it as:
    Code (csharp):
    1. gameoverB = false;

    However, in IEnumerator SpawnWaves() you test:
    Code (csharp):
    1. if (gameOver)
    This is where you have a problem. gameOver is not a boolean, it is a method, so your if statement is really confused.
    you need to have:
    Code (csharp):
    1. if (gameoverB)

    Also, things will work better if you change the name of the method from
    Code (csharp):
    1. gameOver()
    to
    Code (csharp):
    1. GameOver()
    Note the capital "G"

    Usually the method names in a Unity C# script are capitalized, like AddScore or UpdateScore or SpawnWaves or even WaitForSeconds
     
    OboShape likes this.
  28. troile696

    troile696

    Joined:
    May 28, 2017
    Posts:
    2
    Thank you! And I'm sorry about the code block, I forgot.
     
  29. Vorpike

    Vorpike

    Joined:
    Jun 24, 2017
    Posts:
    10
    My game has black bars on the edges depending on how wide my Hierarchy tab is, the text floods over to the bars instead of stopping at the background, how do I fix this?
     

    Attached Files:

  30. jtmcgoffin

    jtmcgoffin

    Joined:
    Jun 27, 2017
    Posts:
    1
    I'll answer this here because its the first search result for the problem I found on Google.

    The problem is that the tilt in the Player model is causing the bolts to move up and down in the y-axis. Thus they are leaving the game boundary and disappearing.

    You can fix this by making the game model a child of the player game object, and tilting the model instead of the object.

    The other (and maybe easier) way to fix it is to change the shotSpawn.rotation to Quaternion.Euler(0.0f, 0.0f, 0.0f). This will set the default rotations of your shotSpawn to 0. This fixed my problem.
     
  31. Dzentsetsu

    Dzentsetsu

    Joined:
    Jul 3, 2017
    Posts:
    4
    Hey guys, just starting to learn Unity and got a problem.
    I simply tried everything I could so I asking you for help.
    How to change this script to make it work?

    public class boundary : MonoBehaviour
    {
    void OnTriggerExit(Collider other)
    {
    Destroy(other.gameObject);
    }
    }

    I undestand what script does -it destroyes my parent game obj, so I can't create clones, but I don't undestand how to make him destroy clones. Btw it's from space shooter tutorial.
     
  32. gwnguy

    gwnguy

    Joined:
    Apr 25, 2017
    Posts:
    144
    In general the class name tends to be capitalized (more of a convention) but of course it must match the C# script name.
    In the case below, C# script name is DestroyByBoundary.cs

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. public class DestroyByBoundary : MonoBehaviour
    6. {
    7.    void OnTriggerExit (Collider other)
    8.    {
    9.        Destroy(other.gameObject);
    10.    }
    11. }
    12.  
    It is wired up in Unity as:
    upload_2017-7-3_13-34-28.png

    (Note he Script name in the inspector for the Boundary object)

    Confirm your Boundary object has the Tag set to "Boundary"
    Confirm Is Trigger is checked on the Box Collider
    Confirm that nothing in your game comes from the "Complete" tree - no scripts, prefabs, etc.
    Confirm there are no other errors in the console

    Try closing and reopening Unity.
     
    Last edited: Jul 3, 2017
  33. Vorpike

    Vorpike

    Joined:
    Jun 24, 2017
    Posts:
    10
    Missed some parts of the "Setting up the project" video, all good now.
     
  34. Dzentsetsu

    Dzentsetsu

    Joined:
    Jul 3, 2017
    Posts:
    4
    Thanks for complete answer. I followed every step u provide me with but still have no result.
    Снимок.PNG Снимок1.PNG

    I got an idea which is as soon as I assign Boundary with Tag "Boundary", I can check this Tag in my script and destroy gameobjs without this Tag. Maybe I choose a wrong way to approach my goal?

    Code (CSharp):
    1. void OnTriggerExit(Collider other)
    2.     {
    3.         if (gameObject.tag != "Boundary")
    4.         {
    5.             Destroy(other.gameObject);
    6.         }
    7.     }
    8.  
     
    Last edited: Jul 4, 2017
  35. AzulRyuukokoro

    AzulRyuukokoro

    Joined:
    Apr 16, 2017
    Posts:
    21
    Hi I'm getting this message and don't know how to fix it. upload_2017-7-4_13-16-30.png
    My code -
    upload_2017-7-4_13-18-17.png
     
  36. Semipro211

    Semipro211

    Joined:
    Jul 3, 2017
    Posts:
    1
    I just have a quick question relating to adding Audio to the game. It seems to work if I go through the "Add Component" route and select Audio source, but I am not able to drag audio onto the game object as shown in the video. It just adds the audio asset as a standalone game object.

    What am I missing? And I apologize if it is something silly. upload_2017-7-4_13-50-38.png upload_2017-7-4_13-50-58.png
     
  37. gwnguy

    gwnguy

    Joined:
    Apr 25, 2017
    Posts:
    144
    Try replacing the curly braces at lines 44 and 48 with parenthesis:
    Code (csharp):
    1.  
    2.         GetComponent<Rigidbody>().position = new Vector3
    3.         (
    4.             Mathf.Clamp(GetComponent<Rigidbody>().position.x, boundary.xMin, boundary.xMax),
    5.             0.0f,
    6.             Mathf.Clamp(GetComponent<Rigidbody>().position.z, boundary.zMin, boundary.zMax)
    7.         );
    8.  
     
  38. gwnguy

    gwnguy

    Joined:
    Apr 25, 2017
    Posts:
    144
    As I understand the game, the script is placed on the Boundary so that anything that collides with the boundary will be destroyed (since it's leaving the game).
    So, the shots your player shoots go up and hit the top of the boundary and are destroyed.
    The asteroids spawned from the top fall down through the bottom of the boundary and are destroyed, assuming you dont destroy them first.
    The enemies spawned from the top go down through the bottom of the boundary and are destroyed, assuming you dont destroy them first.
    The shots the enemy shoots that drop from the top go down through the bottom of the boundary and are destroyed.

    I'm not sure which episode you are in the game development, I'm not sure what the problem is you're having.
    Is something not being destroyed? Asteroids? enemies? shots?


    You should be careful about making mods to the code. Some may be called for because it's not at the most current Unity level,
    but I don't think thats the case with the code block you're in.

    I could be very wrong, it's been a while since I did this one.
     
  39. AzulRyuukokoro

    AzulRyuukokoro

    Joined:
    Apr 16, 2017
    Posts:
    21
    Thank you
     
  40. DrakUnlimited

    DrakUnlimited

    Joined:
    Jul 5, 2017
    Posts:
    10
    The update guide has a code error on page 14, the example code doesn't name the private Rigidbody variable (line 2. below), and should be corrected as shown by the bold text:

    Code (csharp):
    1.  
    2. private Rigidbody [b]rb[/b];
    3. void Start ()
    4. {
    5. rb = GetComponent<Rigidbody>();
    6. }
    7.  
    Edit: the bold tags used since bold doesn't show up in a code block (of course :))
     
  41. Dzentsetsu

    Dzentsetsu

    Joined:
    Jul 3, 2017
    Posts:
    4
    I'm actually not that far.
    This is the exact step
    https://unity3d.com/ru/learn/tutorials/projects/space-shooter-tutorial/boundary?playlist=17147
    I also started to learn C# from the basics because of this error and hoping to undestand how to fix it by my self
     
  42. gwnguy

    gwnguy

    Joined:
    Apr 25, 2017
    Posts:
    144

    If shots, asteroids, or enemies aren't being destroyed when they collide with the Boundary, then I would suspect your Unity game objects aren't set up correctly (check colliders and triggers).

    From your original message you write:
    "but I don't understand how to make him destroy clones"

    it is this code, specifically
    Destroy(other.gameObject);
    that destroys the clones when an object collides with the boundary.

    What is the problem/error you are having that makes you think that he code isn't working correctly and needs fixing?
     
  43. Dzentsetsu

    Dzentsetsu

    Joined:
    Jul 3, 2017
    Posts:
    4
    You will laugh man... I somehow corrected my mistake while checking my scripts settings and I don't get how I did it XD
     
  44. yours_truly29

    yours_truly29

    Joined:
    Jul 6, 2017
    Posts:
    1
    how come on the part where I have to set up the build target it doesn't give me the option to choose web player ?
     
  45. DrakUnlimited

    DrakUnlimited

    Joined:
    Jul 5, 2017
    Posts:
    10
    @yours_truly29

    I'm not a unity professional, so this is just my 2 cents ;), but I believe the Unity WebPlayer used functionality most newer web browsers no longer support (NPAPI)

    WebGL is the new standard being used by web browsers, and is more versatile and "safer." WebGL is the new equivalent to web player and uses the browser's built in functionality, instead of a plug-in I believe, so more accessible and native as well.
     
    Last edited: Jul 6, 2017
  46. DrakUnlimited

    DrakUnlimited

    Joined:
    Jul 5, 2017
    Posts:
    10
    Typo Upgrade guide page 21:

    To access the local Rigidbody component, please use
    “GetComponent<AudioSource>().”

    SHOULD BE:
    To access the local AudioSource component, please use
    “GetComponent<AudioSource>().”

    ALSO:

    "Please declare a local member variable to hold the Rigidbody
    reference by writing at the top of the class:"

    SHOULD BE:


    "Please declare a local member variable to hold the AudioSource
    reference by writing at the top of the class:"
     
    Last edited: Jul 6, 2017
  47. ProgSion

    ProgSion

    Joined:
    Jun 20, 2017
    Posts:
    1
    My ships do not enter the scene, they sit above and shoot down. If I disable Evasive movements, the ships fly down the screen controlled by the mover script. When they are both on, the ships do not move along the Z axis.

    I have checked the code in both scripts, and in game controller. Game controller instantiates the hazards, the asteroids work fine , but the enemy ships are stuck above the screen. I am collecting the current velocity from the game objects rigidbody component and using that in FixedUpdate to set the new velocity.

    I'm not receiving any errors from the console. Any ideas?
     
  48. DrakUnlimited

    DrakUnlimited

    Joined:
    Jul 5, 2017
    Posts:
    10
    Also, the whole first part of the video going over 3d audio (video 3.1) should have a unity 5 annotation at least mentioning that the "3D Sound" flag is now a slider on the audio source object (shown later in the video) instead of a checkbox in the audio import options (as shown in the video). Might also want to mention that the 2D<-->3D slider should be slid all the way to 2D (which it seems to be by default)

    https://docs.unity3d.com/Manual/UpgradeGuide5-Audio.html
     
    Last edited: Jul 6, 2017
  49. DrakUnlimited

    DrakUnlimited

    Joined:
    Jul 5, 2017
    Posts:
    10
    Again in section 3.1 (Audio), it seems dragging the audio clips to the prefabs (either in the assets tree, or to the inspector) as shown in the video just creates an instance of the audio clip in a new GameObject (with an audio source) in the hierarchy - at least this is what it did for me.

    To get it working correctly, I had to select each prefab in the assets list, add component -> Audio -> Audio Source, then drag the audio clip onto the AudioSource's AudioClip property.
     
    lauravc69 likes this.
  50. DrakUnlimited

    DrakUnlimited

    Joined:
    Jul 5, 2017
    Posts:
    10
    Last edited: Jul 6, 2017