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

Space Shooter Tutorial Q&A

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

  1. LelandGreen

    LelandGreen

    Joined:
    Oct 6, 2017
    Posts:
    13
    How can I edit or replace the "Readme.asset"?

    I've made significant code changes and feel it's worth changing that Readme.
     
  2. Pridak

    Pridak

    Joined:
    Aug 6, 2017
    Posts:
    1
    Hello,

    in the build settings i have no "web player" option and the video doesnt really mentions how should i get it. please someone can help ?
     
    Last edited: Nov 6, 2017
  3. LelandGreen

    LelandGreen

    Joined:
    Oct 6, 2017
    Posts:
    13
    Certainly. Just use "WebGL", instead. That uses HTML5, which is much more efficient. (Same usage.)
     
    bertenernie likes this.
  4. tknell90

    tknell90

    Joined:
    Nov 7, 2017
    Posts:
    3
    I have the same issue, tried it with Unity 2017.2.0f3 and 2017.3.0b5 - in both versions, the three explosions are not showing anything. Not in the scene view, not in the game view, nor in any built version of the game. Anyone got an idea on what the problem could be?

    Like Aiku1337 described, the Particle System itself is working, the engine works fine and the default particles when creating a new Particle System also work fine.

    I also tried with Unity 5.1.5f1 - there the explosions work fine.
     
  5. wmmayfield

    wmmayfield

    Joined:
    Nov 2, 2017
    Posts:
    18
    Thanks fro letting the rest of know.
     
  6. wmmayfield

    wmmayfield

    Joined:
    Nov 2, 2017
    Posts:
    18
    I'm working through the extended Space Shooter tutorial. I'm stalled by my enemy ship appearing on the same spot as my hero ship a few seconds into the game each time I start the game. The hero ship explodes and the game is over. I've learned that shortly after starting a game if I can move the hero ship away from its origination location I can avoid killing the hero ship. However, the enemy ship remains at the bottom of the scene shooting but going nowhere. My astroids continue to fall as desired.

    Anyone have any thoughts as to what 's happening? I can provide scripts if needed.

    Any help is really appreciated.

    Bill
     
  7. djvandebrake

    djvandebrake

    Joined:
    Nov 11, 2017
    Posts:
    1
    Hello! Fairly new to Unity and working my way through this tutorial when I got stuck early on. The issue is player movement scripting.

    For some reason, my ship doesn't move. I have used the arrow keys and the WASD keys. I have verified that the Player object has a Rigidbody component, and that my PlayerController script is attached to the object.

    My current code is as follows:
    Code (CSharp):
    1.  
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using UnityEngine;
    5.  
    6. public class PlayerController : MonoBehaviour {
    7.     public int speed;
    8.    
    9.     private Rigidbody rb;
    10.    
    11.     void Start() {
    12.             rb = GetComponent<Rigidbody>();
    13.     }
    14.    
    15.     void fixedUpdate () {
    16.         float moveHorizontal = Input.GetAxis("Horizontal");
    17.         float moveVertical = Input.GetAxis("Vertical");
    18.        
    19.         Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
    20.         rb.AddForce(movement * speed);
    21.     }
    22. }
    The last line started off as rb.velocity = movement; and I also tried rb.position thinking it may have changed in the upgrade (the upgrade guide uses that but I'm reading a bit ahead of the video. I also tried deliberately mispelling velocity (and the compiler flagged it, so at least I know it recognizes what rb is). I then looked back at the Roll-A-Ball tutorial and decided to try the AddForce method. This didn't work either. I added the speed factor as a test thinking perhaps maybe there was an error in the linking to the player object, but the public variable shows up in the inspector frame. I get no compiler errors or even warnings so I'm not sure what is going on. Would appreciate a second (or more!) pair of eyes to see if I made a mistake in my script.
     
  8. wmmayfield

    wmmayfield

    Joined:
    Nov 2, 2017
    Posts:
    18
    djvandebrake

    Try cutting line "private Rigidbody rb;" and changing "rb.AddFroce(movement * speed);":
    to "GetComponent<Rigidbody> ().velocity = movement * speed;".

    See if that works.

    Bill
     
  9. gwnguy

    gwnguy

    Joined:
    Apr 25, 2017
    Posts:
    144
    Try capitalizing the method name:
    from: void fixedUpdate () {
    to: void FixedUpdate () {
     
  10. lauravc69

    lauravc69

    Joined:
    Nov 12, 2017
    Posts:
    2
    Thanks for this. I was struggling.
     
  11. Keita-kun

    Keita-kun

    Joined:
    Aug 20, 2017
    Posts:
    36
    Well, 2017.2.0f.3 doesn't include target platforms anymore it is a separate download if you want web player you download it from here UnitySetup-WebGL-Support-for-Editor-2017.2.0f3.exe. Regarding the latter if you are going to target Facebook/GameRoom have a separate install of Unity for it with FB support only, when mixed with other target platform gives many errors preventing builds...
     
  12. KrishanLal

    KrishanLal

    Joined:
    Nov 16, 2017
    Posts:
    1
    Hi Guys... fairly new to unity... can someone tell me why i don't have the "Web Player" option. does it have to do with the different versions. the video tutorials are for Unity 4 but i am using 5.4. has there been any upgrades??

    upload_2017-11-16_21-36-22.png

    upload_2017-11-16_21-36-38.png

    Thanks
     
  13. tknell90

    tknell90

    Joined:
    Nov 7, 2017
    Posts:
    3
    The Web Player was dropped in favor of WebGL, as the browser vendors dropped (or will drop?) the neccessary APIs needed for the Web Player

    https://blogs.unity3d.com/2015/10/08/unity-web-player-roadmap/
     
  14. Burgers_and_Frys

    Burgers_and_Frys

    Joined:
    Nov 2, 2017
    Posts:
    5
    Hi, I was having issues with my scene where I load it in and it doesn't work. Everything is gone that I worked on.
    This is the error I find

    (Filename: C:\buildslave\unity\build\Runtime/Serialize/SerializedFile.cpp Line: 745)

    Unknown error occurred while loading 'Assets/_Scenes/Main.unity'.

    (Filename: C:\buildslave\unity\build\Runtime/PreloadManager/LoadSceneOperation.cpp Line: 115)

    Invalid serialized file header. File: "Assets/_Scenes/Main.unity".

    (Filename: C:\buildslave\unity\build\Runtime/Serialize/SerializedFile.cpp Line: 745)

    Invalid serialized file header. File: "Assets/_Scenes/Main.unity".

    (Filename: C:\buildslave\unity\build\Runtime/Serialize/SerializedFile.cpp Line: 745)

    Invalid serialized file header. File: "Assets/_Scenes/Main.unity".

    (Filename: C:\buildslave\unity\build\Runtime/Serialize/SerializedFile.cpp Line: 745)

    Invalid serialized file header. File: "Assets/_Scenes/Main.unity".

    (Filename: C:\buildslave\unity\build\Runtime/Serialize/SerializedFile.cpp Line: 745)

    Invalid serialized file header. File: "Assets/_Scenes/Main.unity".

    (Filename: C:\buildslave\unity\build\Runtime/Serialize/SerializedFile.cpp Line: 745)

    If there is any ideas to fix it please!
     
  15. jimmack

    jimmack

    Joined:
    May 2, 2016
    Posts:
    20
    I was having the same problem. Everything OK except the particle systems. I tried this fix you mentioned for the burst value and now I can see them. A value of 1 seemed to work for the player explosion.

    I thought it might be because I am using the Linux version, but I think you're onto something here :)

    Thanks.
     
  16. tknell90

    tknell90

    Joined:
    Nov 7, 2017
    Posts:
    3
    Yup, that seems to be the cause of the problem. I looked further into it and compared the "Bursts" in Unity 5.x and Unity 2017. The result: The "Particles" Property of the Bursts was renamed to "Count" - But the provided Assets only have the "Particles" property set, which is no longer working in Unity 2017. I manually transferred the values to the "Count" property and created a package with the fixed explosions. I hope I exported them correctly, first time exporting a package.

    Can someone try if that fixes the problem for them?
     

    Attached Files:

    jimmack likes this.
  17. Simonv1982

    Simonv1982

    Joined:
    Nov 18, 2017
    Posts:
    2
    Hello,

    Currently doing the Space Shooter tutorial, and I'm up to the "Boundary" lesson.

    Everything has gone fine up until the end, when testing the game, I can shoot a few bolts, but then when those disappear, I can't shoot any more.

    My code for 'DestroyByBoundary" is posted below, I've tried changing it to another bit of code I found on this thread, but no luck.

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5.  
    6. public class DestroyByBoundary : MonoBehaviour{
    7.  
    8.     void OnTriggerExit(Collider other)
    9.     {
    10.         if (other.transform.parent == null)
    11.         {
    12.             Object.Destroy(other.gameObject);
    13.         }
    14.         else
    15.         {
    16.             Object.Destroy(other.transform.parent.gameObject);
    17.         }
    18.     }
    19. }
    Thanks for any help.
     
  18. jimmack

    jimmack

    Joined:
    May 2, 2016
    Posts:
    20
    Thanks tknell90, that's fixed it completely. I just imported your package into my existing project (I'm just trying to get Audio working). I de-selected the materials, because I already had those, but included all the Prefabs you packaged up. They successfully replaced my existing prefabs and now all those explosion animations are working very nicely :)
     
  19. jimmack

    jimmack

    Joined:
    May 2, 2016
    Posts:
    20
    I probably need more info to help you here, but the first thing I noticed is that my DestroyByBoundary.OnTriggerExit code only contains a single line:
    Code (CSharp):
    1. public class DestroyByBoundary : MonoBehaviour
    2. {
    3.     void OnTriggerExit(Collider other)
    4.     {
    5.         Destroy(other.gameObject);
    6.     }
    7. }
    However, I tried your code and it didn't really make any difference.

    I suspect you've got a problem with the setup of the collider, or perhaps with the bolts. Did you only remove the Mesh Renderer and Mesh Filter from the Boundary? ie. is the Box Collider still present and active :) ?

    When you take your shots, do you see them appear in the Hierarchy view? Do those entries disappear from the Hierarchy view when the bolts leave the screen?
     
  20. jimmack

    jimmack

    Joined:
    May 2, 2016
    Posts:
    20
    Has anyone else had a major failure with the audio part of this tutorial on Linux, using 2017.2.0f1? I can't drag and drop any of the provided audio files onto the explosion_asteroid prefab. If I add an audio source component manually I can't drag any of them onto the AudioClip field and if I click the picker icon (circle with a dot) on the right hand side of the manually added audio source component, it only lists the "None" option.

    I thought that the files might be out of date, or formatted incorrectly for this new version and the WebGL target, so I've tried saving one as an MP3, but that still won't drag and drop or show up in the picker.

    It might be worth mentioning that there is no preview for any of the audio files (including my MP3 version), but all the other Import Settings are there. Force to Mono is disabled but the sub-option of Normalize is ticked, as are Load In Background and Ambisonic.

    Any suggestions welcome :)

    Thanks.

    (All the audio files play OK on the various media players I have installed)

    Ah! I found it. I just tried changing the build target to PC, Mac and Linux Standalone and all the audio clips suddenly got icons and when I clicked one, the preview window showed up. They can be dragged into the AudioClip fields on the Audio Sources. I think I'll just stick with this build target now. Hope that helps anyone else who has found the same or similar issues.

    (Is this a bug that I should report somewhere?)
     
    Last edited: Nov 19, 2017
  21. GreenWizard01

    GreenWizard01

    Joined:
    Nov 19, 2017
    Posts:
    3
    I'm following the Space Shooter tutorial working in Unity 5 and following the updates for version 5, when i try to get the ship to move i get a nullreference error as far as i can see i have been following the updates not really sure where im going wrong Error.png Error2.png
     
  22. jimmack

    jimmack

    Joined:
    May 2, 2016
    Posts:
    20
    Instead of
    Code (CSharp):
    1. rb.AddForce(movement);
    Try:

    Code (CSharp):
    1. rb.velocity = movement * speed;
     
  23. GreenWizard01

    GreenWizard01

    Joined:
    Nov 19, 2017
    Posts:
    3
    I changed it and still have the same nullreference error when i try to run the game
     
  24. jimmack

    jimmack

    Joined:
    May 2, 2016
    Posts:
    20
    Ahhhhh! I spotted it :)

    Code (Csharp):
    1. void Start()
    It should be a capital "S", or it won't be recognised as the Start method.
     
  25. Swarmling

    Swarmling

    Joined:
    Nov 20, 2017
    Posts:
    2
    Hi, Working my way through the tutorial but I've gotten stuck at making shots. I keep getting errors related to the Transform.forward element. If can see the issue please let me know.

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class Mover : MonoBehaviour {
    6.     private Rigidbody rb;
    7.     public float speed;
    8.  
    9.     void Start () {
    10.         rb = GetComponent<Rigidbody>();
    11.  
    12.         rb.velocity = Transform.forward*speed;
    13.     }
    14.  
    15. }
    16.  
     
  26. jimmack

    jimmack

    Joined:
    May 2, 2016
    Posts:
    20
    Lower case "t" on "transform" :)

    Code (CSharp):
    1.  
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using UnityEngine;
    5.  
    6. public class Mover : MonoBehaviour
    7. {
    8.         public float speed;
    9.  
    10.         private Rigidbody rb;
    11.                                                                                                                                                                                                                                                    
    12.         // Use this for initialization
    13.         void Start ()
    14.         {
    15.                 rb = GetComponent<Rigidbody> ();
    16.                 rb.velocity = transform.forward * speed;
    17.         }
    18. }
    19.  
    20.  
     
    Swarmling likes this.
  27. Swarmling

    Swarmling

    Joined:
    Nov 20, 2017
    Posts:
    2
    Thank you
     
    jimmack likes this.
  28. GreenWizard01

    GreenWizard01

    Joined:
    Nov 19, 2017
    Posts:
    3
    running perfect now thank you
     
    jimmack likes this.
  29. redrockwolf69

    redrockwolf69

    Joined:
    Nov 21, 2017
    Posts:
    2
    I can't seem to get my script to work.

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;

    public class PlayerController : MonoBehaviour
    {
    private Rigidbody rb;
    void Start()
    {
    rb = GetComponent<Rigidbody>();
    }
    public float speed;

    void FixedUpdate();
    {
    float moveHorizontal = Input.GetAxis("Horizontal");
    float moveVertical = Input.GetAxis("Vertical");


    Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical);
    rb.velocity = movement * speed;
    }
    }

    Unity is giving me the message:
    "No MonoBehavior scripts in the file, or their names do not match the file name."
    I discovered this when I imported the script to Unity and tried to test the script. Nothing appeared in the regular window for messages. The script editor is showing the "=" in the line "rb.velocity = movement * speed;" is an "invalid token", and the last bracket is listed the same way. What did I do wrong? I've been replaying the tutorial and rereading the "ownCloud" for the last hour, trying to figure it out.
     
  30. gwnguy

    gwnguy

    Joined:
    Apr 25, 2017
    Posts:
    144
    You have a semi colon at the end of the method line
    void FixedUpdate();
    it should be
    void FixedUpdate()
     
    jimmack and redrockwolf69 like this.
  31. arnhmail

    arnhmail

    Joined:
    Oct 14, 2017
    Posts:
    13
    Hi guys,

    I've got a quick question regarding the asteroid tumble script;
    I've copied the code word for word, no spelling or capitalization errors, and I've updated the rigidbody to rb as the update log suggests.

    What's happening is that my asteroid gets a random rotation (as it should) but this rotation does not continue to turn. I'm using
    Code (CSharp):
    1. public class RandomRotator : MonoBehaviour
    2. {
    3.     public float tumble;
    4.     private Rigidbody rb;
    5.        
    6.  
    7.     void Start()
    8.     {
    9.         rb = GetComponent<Rigidbody>();
    10.         rb.angularVelocity = Random.insideUnitSphere * tumble;
    11.     }
    12. }
    and while every time I launch or create an asteroid it gives it a new rotation, this rotation/angle doesn't have any force on it, and my asteroid doesn't tumble.

    Has something changed in the last few weeks with unity, or is there something simple I'm missing?

    I've checked my code word for word, and I'm a bit lost.

    Thanks!
     
  32. Elicaf

    Elicaf

    Joined:
    Nov 21, 2017
    Posts:
    1
    Hi all

    i have problems with Lights:
    When i press R for restart game, the lights change on the ship and asteroids. Values in the Main light and others don't change
    Capture1.PNG
    Capture2.PNG
     
  33. Simonv1982

    Simonv1982

    Joined:
    Nov 18, 2017
    Posts:
    2
    Thanks jimmack, I figured it out - it was the "GameObject has been destroyed but you're still trying to access it" problem, which had a few solutions under the YouTube video.
     
    jimmack likes this.
  34. NewSystemGames

    NewSystemGames

    Joined:
    May 23, 2017
    Posts:
    303
    Hi, I don't know if anyone is familiar with the Mobile version, but i just followed the mobile live training video in youtube and i have following errors:
    -Assets/Scripts/Player_Controller.cs(50,18): error CS0019: Operator `&&' cannot be applied to operands of type `method group' and `bool'

    -Assets/Scripts/Player_Controller.cs(85,60): error CS1502: The best overloaded method match for `UnityEngine.Vector3.Vector3(float, float, float)' has some invalid arguments

    -Assets/Scripts/Player_Controller.cs(85,86): error CS1503: Argument `#3' cannot convert `double' expression to type `float'

    -Assets/Scripts/Player_Controller.cs(92,3): error CS0127: `Player_Controller.FixAccelleration(UnityEngine.Vector3)': A return keyword must not be followed by any expression when method returns void


    script:
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. [System.Serializable]
    6. public class Boundary
    7. {
    8.     public float xMin, xMax, zMin, zMax;
    9. }
    10. public class Player_Controller : MonoBehaviour
    11. {
    12.     private Rigidbody rb;
    13.  
    14.     public float speed;
    15.     public float tilt;
    16.     public float fireRate;
    17.  
    18.     public SimpleTouchPad touchPad;
    19.  
    20.     private float nextFire;
    21.  
    22.     public Boundary boundary;
    23.  
    24.     public GameObject shot;
    25.     public GameObject shot2;
    26.     public GameObject shot3;
    27.  
    28.     public Transform shotSpawn;
    29.     public Transform shotSpawn2;
    30.     public Transform shotSpawn3;
    31.  
    32.     private Game_Controller gamecontroller;
    33.  
    34.     private Quaternion calibrationQuaternion;
    35.  
    36.     public SimpleTouchAreabutton areaButton;
    37.  
    38.     void Start()
    39.     {
    40.         GameObject gameObj = GameObject.FindWithTag ("SimpleTouchPad");
    41.         if (gameObj != null) {
    42.             touchPad = gameObj.GetComponent<SimpleTouchPad> ();
    43.         }
    44.         CalibrateAccellerometer ();
    45.         rb = GetComponent<Rigidbody> ();
    46.     }
    47.     void Update ()
    48.     {
    49. //        if (Input.GetButton ("Fire1") && Time.time > nextFire)
    50.         if (areaButton.CanFire && Time.time > nextFire) {
    51.             nextFire = Time.time + fireRate;
    52.             //GetComponent<AudioSource> ().Play ();
    53.             GameObject clone = Instantiate (shot, shotSpawn.position, shotSpawn.rotation) as GameObject;
    54.             GameObject clone2 = Instantiate (shot2, shotSpawn2.position, shotSpawn2.rotation) as GameObject;
    55.             GameObject clone3 = Instantiate (shot3, shotSpawn3.position, shotSpawn3.rotation) as GameObject;
    56.         }
    57.     }
    58.        
    59.     void FixedUpdate ()
    60.  
    61.     {
    62. //        float moveHorizontal = Input.GetAxis ("Horizontal");
    63. //        float moveVertical = Input.GetAxis ("Vertical");
    64.  
    65. //        Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
    66. //        Vector3 accelerationRaw = Input.acceleration;
    67. //        Vector3 acceleration = FixAccelleration (accelerationRaw);
    68. //        Vector3 movement = new Vector3 (acceleration.x, 0.0f, acceleration.y);
    69.         Vector2 direction = touchPad.GetDirection ();
    70.  
    71.         Vector3 movement = new Vector3 (direction.x, 0.0f, direction.y);
    72.  
    73.         rb.velocity = (movement * speed);
    74.  
    75.         Vector3 bounds = new Vector3 ((Mathf.Clamp (rb.position.x, boundary.xMin, boundary.xMax)), 0.0f, (Mathf.Clamp (rb.position.z, boundary.zMin, boundary.zMax)));
    76.  
    77.         rb.position = bounds;
    78.  
    79.         rb.rotation = Quaternion.Euler (0.0f, 0.0f, (rb.velocity.x * -tilt));
    80.     }
    81.  
    82.     void CalibrateAccellerometer()
    83.     {
    84.         Vector3 accelerationSnapshot = Input.acceleration;
    85.         Quaternion rotateQuaternion = Quaternion.FromToRotation (new Vector3 (0.0f, 0.0f, -1.0), accelerationSnapshot);
    86.         calibrationQuaternion = Quaternion.Inverse (rotateQuaternion);
    87.     }
    88.  
    89.     void FixAccelleration (Vector3 acceleration)
    90.     {
    91.         Vector3 fixedAcceleration = calibrationQuaternion * acceleration;
    92.         return fixedAcceleration;
    93.     }
    94. }
     
  35. xiangyang-95

    xiangyang-95

    Joined:
    Nov 12, 2017
    Posts:
    1
    Instead of using GUIText, I tried to use UI Text instead. However, my camera can't seem to capture the text and I'm not sure how to troubleshoot this. Can someone show me how to position the text such that it will appear in the game view?
     
  36. lauravc69

    lauravc69

    Joined:
    Nov 12, 2017
    Posts:
    2

    Thank you. This was really confusing me. Your instructions were perfect.
     
  37. HealthTanks

    HealthTanks

    Joined:
    Sep 28, 2016
    Posts:
    2
    Hello, I'm new to Unity/Programming and I'm working on the Space Shooter Tutorial.

    Following the guide, I'm trying to make the spaceship move using the Player Controller Script. I followed the video exactly and I still can't get my player to move accordingly. Here I show the error I get when running the game and the bottom image is my script. Thank you.


    TroubleShoot1.png TroubleShoot2.png
     
  38. gwnguy

    gwnguy

    Joined:
    Apr 25, 2017
    Posts:
    144
    Capitalize the word "start" at line 17.
    is: void start()
    should be: void Start()
     
  39. HealthTanks

    HealthTanks

    Joined:
    Sep 28, 2016
    Posts:
    2
    Works now, Thank you!
     
  40. luminalstudios

    luminalstudios

    Joined:
    Nov 16, 2017
    Posts:
    6
    When changing the mesh collider (The player GameObject video, 7:20) for PC, it does not work at all like the video displays, and there are no notes in the Space Shooter Upgrade Guide at that point to explain how to select a new mesh. I had to press the small 'circle-dot' radio button to the right of the mesh field to bring up a selection box, from which I could select a new mesh (new behavior for me). The problem is that the available selections did not seem to be the same as the contents of the of the Models directory (the one highlighted when you click on the mesh field). The Model directory includes 'vehicle_playerShip_collider', whereas the selection box displays 'player_ship_collider'.

    It appears that the selection box is displaying the mesh name for the vehicle_playerShip_collider object instead of the object name. Small detail, but it's stuff like this that frustrates new users.
     
  41. arnhmail

    arnhmail

    Joined:
    Oct 14, 2017
    Posts:
    13
    Is no one else having issues with Tumble? I have exactly what the update guide suggests, code pasted here:
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class RandomRotator : MonoBehaviour
    5. {
    6.     public float tumble;
    7.     private Rigidbody rb;
    8.  
    9.     void Start()
    10.     {
    11.  
    12.         rb = GetComponent<Rigidbody>();
    13.         rb.angularVelocity = Random.insideUnitSphere * tumble;
    14.     }
    15. }
    and this is my asteroid config. Anyone got any ideas?
    Also, when I now drag multiple ones onto the scene, they just kinda go in random directions instead of rotating. Any thoughts?
     
  42. Binaural-Audio-Guy

    Binaural-Audio-Guy

    Joined:
    Nov 27, 2017
    Posts:
    2
    Im a total beginner too, to Unity and to C#

    I completed the Roll a Ball with no problems but then in the Space Shooter I got stuck on video 5 as the script to move the spaceship player just would not work.
    The compiler did not like the term "velocity" As if it doesnt exist in the latest version of unity or hasnt been defined in the script?? I installed the latest version of Unity on the 19th Of Nov 2017 this is the only version I have been working with.

    I was following the videos on yourtube but when I got stuck I went to the unity site in their tutorials and found the page for video 5 of the Space Shooter tutorial and copied and pasted the code that was on that page but it will not work!!??

    Im not sure what to do?

    I attached a screen grab of the problems highlighted in red

    Thanks for any suggestions!




     

    Attached Files:

  43. rcs300

    rcs300

    Joined:
    Nov 28, 2017
    Posts:
    1
    Hi, Im trying to follow the tutorial but about creating the new project, theres no Web Player under Platforms selection... Id like to stick with this newest version of unity, Which should I pick instead?
     
    rmgemed likes this.
  44. someradam

    someradam

    Joined:
    Nov 14, 2017
    Posts:
    1
    I am having problems building the game and would appreciate any help that anyone can provide.

    Here's what happened...

    I built it successfully once and noticed a few aesthetic problems that I wanted to go back and correct. So I deleted the build, made the corrections in Unity, tested in Unity and had to go out for a while. When I came back to my computer a while later, I tried to build again and that's where the problems started.

    First, I tried to build it for WebGL. This is what happened:

    upload_2017-11-28_17-23-36.png

    'Try again" did not work so I hit 'cancel' and all of the sudden there were a whole bunch of errors. Here they are:

    upload_2017-11-28_17-25-47.png

    upload_2017-11-28_17-26-41.png

    upload_2017-11-28_17-27-16.png

    I searched around, but haven't been able to figure out what's wrong and how to fix it. I'm assuming human error. Does anyone know what I broke and how I might fix it?

    Thank you in advance. upload_2017-11-28_17-23-36.png upload_2017-11-28_17-25-47.png upload_2017-11-28_17-26-41.png upload_2017-11-28_17-27-16.png
     
    sftsstt likes this.
  45. Binaural-Audio-Guy

    Binaural-Audio-Guy

    Joined:
    Nov 27, 2017
    Posts:
    2
    Assets I downloaded from the unity site for this tutorial arent working, the tail of the player ship's graphic doesnt appear neither does the explosion graphic. The already made game is quite different from the one in the tutorial especially when I look in the assets folder to try to replace the assets that arent working for me in my tutorial game that I'm building... its a disappointing end to hours of work over 2 days. Its a big mess UNITY!!! I have this page open, I have a unity 5 update .pdf open and I have my own Unity app open and its script editor and Im watching the video from your site. Things arent matching and things arent working. From the first video tutorial for the SpaceShooter game the engine of the jet didnt work, it just showed a pink square as if the asset was corrupt or missing!! I feel pretty annoyed now and its just been a bit of a brain melt. The experience would really turn me off going futher with Unity. I did think the video tutorials were very good, the presenter had a good voice and pace and I could follow it all but when it doesnt work and there's different versions of Unity and Im not looking at the same interface that the guy in the video is working with.... the GUI Text for the score which wont appear at all... it just becomes very annoying after a while so I wont complete the tutorial and I wont make the build either.
     
  46. unity_f0gFSf9Jnl1E6w

    unity_f0gFSf9Jnl1E6w

    Joined:
    Nov 29, 2017
    Posts:
    1
    i am new to unity and would like to know what i am doing wrong and how i can fix it, thank you.
    upload_2017-11-29_10-23-41.png upload_2017-11-29_10-23-55.png
     
  47. luminalstudios

    luminalstudios

    Joined:
    Nov 16, 2017
    Posts:
    6
    That is exactly what I did, and it seemed to work just fine. Is there any downside?
     
  48. luminalstudios

    luminalstudios

    Joined:
    Nov 16, 2017
    Posts:
    6
    Full disclosure, I'm new to Unity, so I not 100% sure my suggestions will work.

    The error message references the 'Done/Done_Scripts/Done_EvasiveManeuver.cs' script. That script is not part of the demo (at least not at the stage you are at). So, somehow, you have either referenced one of its classes or methods somewhere in one of your scripts or components or you have somehow managed to include it in your build. That script is referencing on object that is not defined within the script: UnityEngine.Component.

    There are several things you could try.

    1. Locate the Done/Done_Scripts/Done_EvasiveManeuver.cs script and verify that it includes the 'using UnityEngine;' statement at the top of the script. If it does not, add the line and save. That should fix the issue. If already contains the statement, move on to suggestion 2.

    2. Find the script and delete it (or rename it to something else if you don't want to delete it). Then attempt to rebuild. If you get no error message, you're probably good. If you do get an error message (it shouldn't be the same message you have now it should be something like 'class not found' or 'Done_EvasiveManeuver.cs script file not found'), try to locate where the reference is in your other scripts or project components and remove it. You should be ok then.
     
  49. luminalstudios

    luminalstudios

    Joined:
    Nov 16, 2017
    Posts:
    6
    You are missing a 'yield return new WaitForSeconds( spawnWait );' just before the end of the for loop. This delay is what spaces the asteroids out vertically.
     
  50. luminalstudios

    luminalstudios

    Joined:
    Nov 16, 2017
    Posts:
    6
    I don't see any issues with your RandomRotator.cs script. And most of your Asteroid components are pretty similar to mine. The major exception is your CapsuleCollider. Mine does NOT have 'is Trigger' set, it center is 0,0.0, and the direction field is set to 'Y-Axis', not Z-Axis. One other minor difference (but maybe it matters), my Rigidbody component has an angular drag of 0.05. You could try making those adjustments.