Search Unity

  1. Check out the Unite LA keynote for updates on the Visual Effect Editor, the FPS Sample, ECS, Unity for Film and more! Watch it now!
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Space Shooter Tutorial Q&A

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

  1. Smart-hawk1

    Smart-hawk1

    Joined:
    May 23, 2017
    Posts:
    200
    Show the code you have, you probably missed something on DestroyOnBoundary script
     
  2. Ryanb360

    Ryanb360

    Joined:
    Sep 13, 2018
    Posts:
    1
    Hey everyone I keep getting:
    Assets/Lobby/Scripts/Lobby/LobbyManager.cs(266,59): error CS0030: Cannot convert type `UnityEngine.Networking.PlayerController' to `PlayerController123'
    I have read the most common fix was to change public class PlayerController : MonoBehaviour to something else so I changed it to public class PlayerController123 : MonoBehaviour

    here is a copy of my code because I am still getting the same error.

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

    harshdulani

    Joined:
    Sep 3, 2018
    Posts:
    6
    here
     using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;

    public class DestroyOnContact : MonoBehaviour
    {
    void onTriggerEnter(Collider other)
    {
    if (other.tag == "Boundary") {
    return;
    }
    Destroy (other.gameObject);
    Destroy (gameObject);
    }
    }


    please do tell me if i should show you any other script files/anything
     
  4. Smart-hawk1

    Smart-hawk1

    Joined:
    May 23, 2017
    Posts:
    200
    Not destroyonContact,

    DestroyOnBoundary ... with the OnTriggerExit Function or you could remove the return in this function but idk how its setup in the tutorial
     
  5. harshdulani

    harshdulani

    Joined:
    Sep 3, 2018
    Posts:
    6
    im sorry. here this is the destroybyboundary function.

    here is the tutorial web page
    https://unity3d.com/learn/tutorials/projects/space-shooter-tutorial/creating-hazards?playlist=17147

    Code (CSharp):
    1. public class DestroyByBound : MonoBehaviour {
    2.  
    3.     void OnTriggerExit(Collider other)
    4.     {
    5.         // Destroy everything that leaves the trigger
    6.         Destroy(other.gameObject);
    7.     }
    8. }
    9.  
     
  6. Smart-hawk1

    Smart-hawk1

    Joined:
    May 23, 2017
    Posts:
    200
    Check that the Collider attached to the Boundary Object is sounding the area, so any object that exit it will be removed.
     
    harshdulani likes this.
  7. harshdulani

    harshdulani

    Joined:
    Sep 3, 2018
    Posts:
    6
    hey these are my inspector windows for all the GameObjects i thought would be relevant. please tell me if theres something wrong with them or i should provide with more information...
    asteroid parent.PNG asteroid prop.PNG boundary.PNG
     
  8. Smart-hawk1

    Smart-hawk1

    Joined:
    May 23, 2017
    Posts:
    200
    How your boundary object looks like in the scene? is it big enough to be over the play area ?
     
    harshdulani likes this.
  9. harshdulani

    harshdulani

    Joined:
    Sep 3, 2018
    Posts:
    6
    here is how the the boundary object looks like, i guess yes it is big enough? scene mode.PNG

    game mode.PNG
     
  10. harshdulani

    harshdulani

    Joined:
    Sep 3, 2018
    Posts:
    6
    thanks for trying to help man. i grew impatient and deleted the Boundary and Asteroid object and started both afresh.
    everything works now ^__^
     
  11. Boromir_2014

    Boromir_2014

    Joined:
    Jun 7, 2018
    Posts:
    5
    Thanks you! I can't understand how I missed a spelling error like this one… But now it works
     
  12. hardcoredarksky

    hardcoredarksky

    Joined:
    Jun 13, 2018
    Posts:
    2
    I'm having difficulty getting the score to display. I know the GUI Text has been replaced. I am using the regular text field. I have my text rotated at 90 degrees on the X Axis. None of the text is displaying. Any suggestions or something I'm missing? Thanks!
     
  13. fernandojose2005

    fernandojose2005

    Joined:
    Sep 29, 2018
    Posts:
    2
    Hoa si aigen me responde si me puede enviar los comandos para que un personaje se mueva con W A S D plis si aigen sabe
     
  14. fernandojose2005

    fernandojose2005

    Joined:
    Sep 29, 2018
    Posts:
    2
    sie responde plis para crear un juego porfavor
     
  15. unity_j8vhEYDk-5hhug

    unity_j8vhEYDk-5hhug

    Joined:
    Sep 26, 2018
    Posts:
    2
    Hello all!

    I am new to unity and all of a sudden have encountered this error? I have uninstalled everything and deleted the projects to start a fresh and straight away upon creating the PlayerController script i get this error still.

    This happens if i create an empty project inserted a game object and attaching a script to that as well.

    Does anyone know why this is happening it is driving me insane lol!

    Thanks in advance!
     

    Attached Files:

  16. unity_792567

    unity_792567

    Joined:
    Oct 1, 2018
    Posts:
    1
    Hello Everyone, So I'm new to unity and I'm on the "Moving the Player" part of the tutorial. I'm on the 2018 version and I'm trying to do the first part( at about 6:50 of this video
    ).

    using UnityEngine;
    using System.Collections;

    public class PlayerController : MonoBehaviour
    {
    private Rigidbody rb;
    public float speed;
    public Rigidbody rb;

    void Start()
    {
    rb = GetComponent<Rigidbody>();
    }
    public class ExampleClass : MonoBehaviour
    {
    float horizontalSpeed = 2.0f;
    float verticalSpeed = 2.0f;

    void FixedUpdate()

    {

    float h = horizontalSpeed.Input.GetAxis {"Horizontal"};
    float v = verticalSpeed.Input.GetAxis {"Vertical"};

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

    It says the "Input.GetAxis{Horizontal/Vertical}, the (moveHorizontal/vertical) part of the Vector3 movement, and rb.velocity part all have errors, can someone please explain what's wrong and what to replace it with?
    Thank you so much!
     
  17. MattLottering

    MattLottering

    Joined:
    Oct 8, 2018
    Posts:
    2
    Hi there, I am running into the same issues, how and where did you create the namespace? Sorry I am very new to this and really struggling to get over this section.

    Thank you
    Matt
     
  18. MattLottering

    MattLottering

    Joined:
    Oct 8, 2018
    Posts:
    2
    Hi all, could anyone please help, I am very new to this and struggling a bit.

    I am at section 5. Moving the player.
    I have made the adjustments to the script to work with the newer version of Unity,

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    public class PlayerController : MonoBehaviour {
    private Rigidbody rb;
    public float speed;
    void Start ()
    {
    rb = GetComponent<Rigidbody>();
    }

    void fixedUpdate ()
    {
    float moveHorizontal = Input.GetAxis ("Horizontal");
    float moveVertical = Input.GetAxis ("Vertical");
    Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
    rb.position = movement * speed;
    }
    }


    But I am still getting errors.

    Assets/Lobby.Scripts/Lobby/LobbyPlayer.cs(147,56): error cs0030: Cannot convert type 'UnityEngine.Networking.PlayerController' to 'PlayerController'?

    public void CheckRemoveButton()
    {
    if (!isLocalPlayer)
    return;
    int localPlayerCount = 0;
    foreach (PlayerController p in ClientScene.localPlayers)
    localPlayerCount += (p == null || p.playerControllerId == -1) ? 0 : 1;
    removePlayerButton.interactable = localPlayerCount > 1;
    }

    And

    Assets/Lobby.Scripts/Lobby/LobbyManager.cs(267,38): error CS0103: The name 'p' does not exist in current context?

    public void OnPlayersNumberModified(int count)
    {
    _playerNumber += count;
    int localPlayerCount = 0;
    foreach (PlayerController p in ClientScene.localPlayers);
    localPlayerCount += (p == null || p.playerControllerId == -1) ? 0 : 1;
    addPlayerButton.SetActive(localPlayerCount < maxPlayersPerConnection && _playerNumber < maxPlayers);
    }

    I hope this makes sense?
    Please help if possible.

    Thank you
    Matt
     

    Attached Files:

  19. JadranD

    JadranD

    Joined:
    Oct 11, 2018
    Posts:
    1
    ...cannot start SpaceShooter...when I start game (play), I get horizon with blue sky screen and it stops ??...
     
  20. Paikan

    Paikan

    Joined:
    Oct 13, 2018
    Posts:
    4
    Hi Matt and unity_j8vhEYDk-5hhug, I had the same problem when doing this project. I assume the code you've written is in Assets/Scripts. The error occurs in Assets/Lobby/Scripts, which is a different folder, part of the original tutorial package. This 'Lobby' folder caused me a ton of problems as well and, to be honest, I don't really understand what it is for... Maybe some kind of local multiplayer.

    Since I wanted to focus on making a simple single-player version of the game to follow the tutorial, I just deleted the 'Lobby' folder, and got no more conflicts. After completing the project (and if you figure out what this folder is for) you could put it back in 'Assets'.

    So yeah, just remove the Lobby folder and everything should be good.
     
    Last edited: Oct 13, 2018
  21. Paikan

    Paikan

    Joined:
    Oct 13, 2018
    Posts:
    4
    Hi everyone. I am new to Unity and have been following the Space Shooter tutorial, up to the 'Build the Game' part, where I am noticing a small problem with my game. Here is how it looks in the Editor :
    UIEditor.png
    Both the 'Score' and 'Restart' UIText objects appear in the right position at the top-left and top-right of the screen. However, when I play the game in the browser, it looks like this :
    UIBrowser.png

    My UIText objects don't appear at the top of the screen, because it is cut off, and the browser page doesn't allow me to scroll up. And if I put the game in Full Screen, well...
    UIBrowserFullScreen.png
    Here is the score Text, at the top left of the screen, and the restart at the top right, in the black areas.
    I tried a different build, in 500x700 resolution : that allowed the browser to display the entire game screen (the top was no longer cut off), but obviously did not fix the full screen UI problem.

    In short, here is what I would like to know :
    1) Is there a way to have the game properly display the 600x900 resolution in the browser window, without having to de-zoom or decrease the resolution of the build ?
    2) Would it be possible to have the UI Canvas always fit the game screen, so that even in full screen the score and restart UIText appear over the space background and not in the black bars ?

    I would really like to know how to properly make UIs, so thank you in advance to anyone who could help me with these two issues ;). Have a nice day !
     
  22. Paikan

    Paikan

    Joined:
    Oct 13, 2018
    Posts:
    4
    Hi, you need to change a couple things :
    1. First off you shouldn't have a public Rigidbody rb and another private Rigidbody rb. You only need a private one, that you correctly assign in the Start() function.
    2. Your FixedUpdate() function is wrong. It should be like this :
    Code (CSharp):
    1. void FixedUpdate(){
    2.         float moveHorizontal = Input.GetAxis("Horizontal");
    3.         float moveVertical = Input.GetAxis("Vertical");
    4.  
    5.         Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical);
    6.  
    7.         rb.velocity = movement * speed;
    8. }
    9.  
    Input is a class in UnityEngine, that contains several methods including GetAxis. In your code you try to call the GetAxis method on horizontalSpeed and verticalSpeed, which are both float values, a basic C# numerical type that has nothing to do with the Unity Input interface. Simply call
    Code (csharp):
    1.  Input.GetAxis("Horizontal");
    (same with Vertical) and put the return values in your two float variables.

    Also, when calling a method, you have to give it parameters with parentheses, and not braces : write Input.GetAxis("Horizontal"); and not Input.GetAxis{"Horizontal"}; like you did.

    Finally the PlayerController.rb.velocity is wrong. PlayerController is a C# script, it does not have a rigidbody attribute. The player does, however, and since rb holds the reference to the rigidbody component of the player object, just write : rb.velocity = movement * speed;

    I hope this helped, tell me if there is something you didn't understand in my answer, or if you encounter a different problem !
     
    Last edited: Oct 13, 2018
  23. AnneSchmidt

    AnneSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    891
    This project has been updated to 2018.2 and expanded. Unfortunately the added things interfere with the tutorial as it is on the site. Removing the following directories from the downloaded project (or not importing them at all) seems to fix the problem (for now):
    • Lobby,
    • SampleScenes
    I hope this is useful to all new Unity users who are following this tutorial (and this has not been posted yet, I haven't read everything in this thread). :)
     
  24. DrAwesomeXD

    DrAwesomeXD

    Joined:
    Nov 18, 2017
    Posts:
    2
    Hi everyone,

    just starting out with Unity,
    quick Question to
    Creating shots - 06

    The tutorial says to use the Z-Axis for the capsule collider. Yet, if I use the Z-Axis with the same values, my collider looks like this: upload_2018-10-14_12-21-0.png


    It only seems to look right, if I use the Y-Axis:

    upload_2018-10-14_12-21-33.png


    Here are the Bolt properties:

    upload_2018-10-14_12-22-6.png

    I would really appreciate any help :)
    Cheers
     
  25. DrAwesomeXD

    DrAwesomeXD

    Joined:
    Nov 18, 2017
    Posts:
    2
    Oh... Sorry I already got it!!
    I set the Capsule Collider on the VFX-Object, not the Bolt-Object.
    It has to be the Bolt-Object!
    The VFX-Object behaved in this way because its rotated by 90 degrees on the X-Axis -.-
     
  26. Lindish

    Lindish

    Joined:
    Jul 21, 2017
    Posts:
    2
    Hi. So I've been following this series but seems today all of the tutorial videos are offline. Just wondering if they are being moved or discontinued or if it is just a technical glitch? Thanks Screenshot_2018-10-17 Audio - Unity.png

    Updated: They seem to be back up now, thankyou
     
    Last edited: Oct 17, 2018
  27. Amosen

    Amosen

    Joined:
    Oct 17, 2018
    Posts:
    1
  28. AnneSchmidt

    AnneSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    891
    Hi,

    I'm currently remaking this tutorial with Unity 2018.2.12f1 Personal and so far, so good.

    In the "Audio" video, at 5:30, it is said that we can drag the audio file onto a prefab without it being visible in the inspector (here dragging the "explosion_player" audio file onto the "explosion_player" prefab); I'm sorry to say that it doesn't work in Unity 2018.2.12f1 Personal.

    I've tried dragging other audio files onto other prefabs, same problem: dragging and dropping the audio file onto the prefab seems to work but the audio file is nowhere in the prefab afterwards but it appears in the Hierarchy, outside the player and at its position. Same thing for the asteroid.

    Edit: After launching Unity this afternoon, I got notification that a new version was available, 2018.2.13f1. After installing it, I imported the project anew and tried adding the audio files to the prefabs: same results. See images below.

    Capture.JPG

    The audio source was not added to the prefabs after dragging and dropping the audio files on them:

    Capture2.JPG

    Capture3.JPG
     
    Last edited: Oct 18, 2018
  29. refschool

    refschool

    Joined:
    Dec 26, 2015
    Posts:
    1
    Hello, I want to access the score in GameController from PlayerController, how can I do this? thank you
     
  30. Paikan

    Paikan

    Joined:
    Oct 13, 2018
    Posts:
    4
    Hi, I've noticed that as well. It seems like they removed that feature. You can still drag the audio file to the inspector however, but they should probably update the tutorial to make that clear.

    Hi, once you've created a reference to the GameController script of the GameController object, call its AddScore method (or access gameController.score directly). I also want to point out that the tutorial does not ask you to access the score from PlayerController, but from DestroyFromContact. Anyway here is the kind of code you can use :
    Code (CSharp):
    1. // Declaring a GameController :
    2. private GameController gameController;
    3.  
    4. void Start ()
    5. {
    6. // We try to find a GameController object in the scene :
    7. GameObject gameControllerObject = GameObject.FindWithTag("GameController");
    8.  
    9.         if (gameControllerObject != null)
    10.         {
    11.             // If we find the GameController, we keep a reference to its GameController script component
    12.             gameController = gameControllerObject.GetComponent<GameController>();
    13.         }
    14.  
    15. }
    16. // Then, wherever we want to add a value to the score :
    17. gameController.AddScore(scoreValue);  // Or if score is public : gameController.score += scoreValue;
     
    Last edited: Oct 20, 2018
  31. AnneSchmidt

    AnneSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    891
    I know that but the most worrying is that the audio files are created in the hierarchy window if we try dragging them on the prefab in the project window. It's not a removed feature, it's a problem.
     
    Paikan likes this.
  32. Xendrax

    Xendrax

    Joined:
    Oct 18, 2018
    Posts:
    3
    In the Extending Space Shooter, he shows us some options regarding shooting "sideways". He notices the shots are disappearing now and then for some reason. This is because when you move and shoot the ship is banking thus the rotation is no longer 0 so the shot is hitting the top of the boundary box and being deleted but because there is no perspective you cannot see tis (unless you look in your scene.

    I tried resetting the instantiated object to 0 on one plane and it seems to just reset it completely to shoot forward?!?! I tired on different axis to see if that was the problem (I still struggle with the global vs local - not sure which the code is doing) but all of them still made the shot that should go sideways just go up.
    So I tried NOT resetting any axis and giving it back the same values and it still shoots up so I know I am doing something wrong here!


    so I changed below (I no have 6 shotSpawners so I can do several different type of directional shots.. maybe for power up later of for different buttons for shot directions)

    Code (CSharp):
    1. Instantiate(shot, shotSpawns[4].position, shotSpawns[4].rotation); //this one shoots to the left
    2. Instantiate(shot, shotSpawns[5].position, shotSpawns[5].rotation); // this one shoots to the right
    to this

    Code (CSharp):
    1. Instantiate(shot, shotSpawns[4].position, shotSpawns[4].rotation); //this one shoots to the left still
    2. GameObject newShot = Instantiate(shot, shotSpawns[5].position, shotSpawns[5].rotation);
    3. newShot.transform.rotation = Quaternion.Euler(newShot.transform.rotation.x, newShot.transform.rotation.y, newShot.transform.rotation.z); //this should in theory do nothing? Its getting its values and putting it back in. I will eventually reset one of these to 0 to get it to stay in the boundary. This however now shoots up?!?!
    Any clues what I am doing wrong?
     
  33. Xendrax

    Xendrax

    Joined:
    Oct 18, 2018
    Posts:
    3
    Ah worked it out .. newShot.transform.rotation.x is acutally a Quaternion!!

    fixed it like this
    Code (CSharp):
    1. GameObject newShot = Instantiate(shot, shotSpawns[5].position, shotSpawns[5].rotation);
    2. Vector3 crntRot = newShot.transform.rotation.eulerAngles;
    3. newShot.transform.rotation = Quaternion.Euler( 0, crntRot.y, crntRot.z);
    This stops the X angle from changing (keeps it at =0) even if the shotspawn has been rotated around the X from the parent when 'banking' for the image. Now just need to do it to all the rest of my shotspawns!
     
  34. cbassar0

    cbassar0

    Joined:
    Oct 26, 2018
    Posts:
    2
    using System.Collections;
    using UnityEngine;

    [System.Serializable]
    public class Boundary
    {
    public float xMin, xMax, zMin, zMax;
    }

    public class PlayerController : MonoBehaviour {

    public float speed;
    public float tilt;
    public Boundary boundary;

    void Start()
    {
    rb = GetComponent<Rigidbody>();
    }

    private Rigidbody rb;

    //fixed update
    private void FixedUpdate()
    {
    float moveHorizontal = Input.GetAxis("Horizontal");
    float moveVertical = Input.GetAxis("Vertical");
    Vector3 movement = new Vector3 (moveHorizontal,0.0f, moveVertical);
    rb.velocity = movement * speed;

    rb.position = new Vector3
    (
    Mathf.Clamp (rb.position.x, boundary.xMin, boundary.xMax),
    0.0f,
    Mathf.Clamp (rb.position.z, boundary.zMin, boundary.zMax)
    );

    rb.rotation = Quaternion.Euler (x, y, z);
    }
    }

    **************************************************************************************************************************************


    Having made these alterations for version 5, CAN SOMEONE EXPLAIN why the ASSETS Lobby manager is complaining about "player controllerId not found? NO ONE IS TALKING ABOUT THIS!!!
     
  35. AnneSchmidt

    AnneSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    891
    Having made these alterations for version 5, CAN SOMEONE EXPLAIN why the ASSETS Lobby manager is complaining about "player controllerId not found? NO ONE IS TALKING ABOUT THIS!!![/QUOTE]
    Please, use the proper tags when you post a script: https://forum.unity.com/threads/using-code-tags-properly.143875/

    The lobby might have something to do with the very last training session about creating the mobile version of the game (https://unity3d.com/learn/tutorials...onverting-space-shooter-mobile?playlist=17147).

    I had to remove the lobby directory to be able to make the tutorial.
     
    Last edited: Oct 26, 2018
  36. MountainousK4

    MountainousK4

    Joined:
    Apr 22, 2018
    Posts:
    2
    I have a problem I hope someone can help with! We just completed section 2.2 "Creating Hazards". When the shot is fired and hits the Asteroid, the DestroyByContact script is supposed to fire and destroy both shotSpawn and Asteroid. But this is not firing, I can tell because I don't see the debug statement I entered writing to the console. The shot does get destroyed when it hits the Boundary (DestroyByBoundary script is working fine)... I have gone back and watched the Creating Shots, Shooting Shots etc... videos and rewatched the 2.2 again, but I can't see what is wrong.

    I have verified the DestroyByContact is attached to my Asteroid, and the code is the same as in the video. I'm using Unity 2017 fyi...

    Could anyone give me an idea why my DestroyByContact script is not firing?
     
  37. MountainousK4

    MountainousK4

    Joined:
    Apr 22, 2018
    Posts:
    2
    EDIT ---> Figured out my IsTrigger was not set on my Asteroid object (duh)
     
  38. PetterL68

    PetterL68

    Joined:
    Jun 26, 2018
    Posts:
    6

    Hi.
    Im a beginner to Unity but have been trough a few tutorials.
    Found this one and have started to make the game, but have run into a few problems
    In Camera and lightning. I have problem to use the new sugested values by the updated guide notes.
    When you adjust the directional light (main Light to point to the ship. It is barely visible. and it look just a black and white.

    Could the capsule collider have anything to do with it?. I kept that one when I had problems with the mesh collider. But found out later that it was OK to turn the Convex on. But did not change back again.
     
    Last edited: Nov 11, 2018 at 10:41 PM
  39. PetterL68

    PetterL68

    Joined:
    Jun 26, 2018
    Posts:
    6
    Im still having problems. Have put inn all 3 lights but the surface of the model is still dark (black*)
    Tried to embed a picture of it but did not work. Followed the video and the notes with no help.
    So I'm Stuck.

    When import the assets i get this message on two of the models of the players ship.
    How do i fix it ?

    A polygon of vehicle_playerShip is self-intersecting and has been discarded.

    Edit: I solved it the hard way by start over. But stil have that last error message.
    But the black and White ship problem did not came back when i was setting up that scene again.
     
    Last edited: Nov 13, 2018 at 10:03 PM
  40. DieuQT

    DieuQT

    Joined:
    Aug 23, 2018
    Posts:
    1
    Hi,

    I'm new to Unity, and have been learning a lot from these Unity Tutorials. I would really like to publish a game I created using the "Space Shooter" tutorial. I finished the tutorial, and then worked on the game further to add new game features, and what I saw to be improvements for the game. I now would like to publish the game as my own, Is that allowed? Can I publish the game as my own? Do I have the rights to do so? Are the assets, and all game material provided in the tutorial and Unity Store (Tutorial for Space Shooter) free to use, and publish?

    Any help would be appreciated! I tried to find the answer but couldn't find it, so I hope someone can help me out.

    Thanks,

    Dieu
     
  41. Taz0707

    Taz0707

    Joined:
    Oct 24, 2018
    Posts:
    1
    Hi everyone.

    I have been learning Unity using the tutorials but have run into a problem with the GUIText as it is saying obsolete in Scripts however the tutorial and updated guide does not have a fix for this issue. I am running version 2018.2.12f1.

    Any ideas how I can get my score text to show up in the game area.
    Thanks
     
  42. AnneSchmidt

    AnneSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    891
    You must first add
    Code (CSharp):
    1. using UnityEngine.UI;
    at the top of the script. Then create the text variable as:
    Code (CSharp):
    1. public Text name;
    (where name is the name given in the tutorial video).

    Then create the ui text by right-clicking in the hierarchy window, go down the list to UI and select text.

    Sans titre-1.jpg

    I think the rest is unchanged. :)