Search Unity

Unity Ruby’s Adventure: 2d Beginner Official Thread

Discussion in 'Community Learning & Teaching' started by Woolley_Kat, Apr 15, 2019.

  1. mitchmunro

    mitchmunro

    Joined:
    Jun 20, 2019
    Posts:
    6
    Hey! I posted this elsewhere and was informed that there is an official Ruby tutorial thread.

    I noticed some issues in the tutorial and wanted to bring them up so they can be updated. If they have already been raised, my apologies!

    I noticed in that the scripts in "Step. 11: Check Your Scripts" seem incorrect and make your game not work as intended. Here are the two issues I noticed:

    - EnemyController Script: After stating "Your EnemyController script should now look like this:" the tutorial lists a bunch of code. At the start, in the declaring function section, it has this "bool broken = false;", when earlier in section 8 of the tutorial we were told to set "broken" to true. Without this, the enemies don't walk as they should.

    - Projectile Script: After stating "Your Projectile script should now look like this:" more code is listed. The first function is "void Start()", but earlier in Section 6 of the tutorial we were told to change that start function to "Awake()". Without this the projectiles don't move.


    I am still very new to unity, so I forgive me if used incorrect terminology. Hopefully this helps, and they creators of the tutorial can change it so people learning aren't as confused as I was at first!
     
  2. JacekPapaPolski

    JacekPapaPolski

    Unity Technologies

    Joined:
    Jul 5, 2017
    Posts:
    32
    Hi mitchmunro!

    Thank you very much for reaching out to us with these issues! Both must have slipped through the cracks and have now been corrected. Good catch!
    Thanks again and good luck with the rest of your Unity journey! :)
     
    mitchmunro likes this.
  3. mitchmunro

    mitchmunro

    Joined:
    Jun 20, 2019
    Posts:
    6
    Thanks for updating so quickly. Glad I can be helpful!
     
  4. mitchmunro

    mitchmunro

    Joined:
    Jun 20, 2019
    Posts:
    6
    This tutorial has a lot of good things, but every so often it assumes too much (this has happened a bunch of times now). It leaves the beginner stuck - stranded - scratching our heads as to where to go next. Since this is an online text tutorial, there is no quick way to ask a question or find the answer. It is a frustrating learning experience.

    The bit I was stuck on was Tutorial 12, Part 8, and how to spawn the particles effects. Here is the instruction:

    "Instantiating a Particle System

    Once you have made a Prefab out of a Particle System, just like your Projectile, it can be created with the Instantiate function.
    So, for an effect that happens only once (like being hit or grabbing a health collectible), you can store a reference to the Prefab in a public variable and call Instantiate when it should happen. If the Particle System is not Looping and Stop Action is set to Destroy, it will play and then be destroyed."

    The problem here is that it assumes that you know which script to put the Instantiate command into, and that you have a good grasp on public variables and how to use them from other scripts (this was mentioned many lessons ago, and even so wasn't in this much depth).

    I got the particle effect to work when you get hit by a robot. I put Instantiate in the Ruby controller script change health function that happens after you get hit (line 11). That didn't take too long.

    But then it took me about 2 hours of trial an error, scouring code, and searching the internet to realise that I could add lines 15 - 18. This checks to see if you gained health, and then if so launches the particle effect.

    Code (CSharp):
    1. public void ChangeHealth(int amount)
    2.     {
    3.         if (amount < 0)
    4.         {
    5.             if (isInvincible)
    6.                 return;
    7.  
    8.             isInvincible = true;
    9.             invincibleTimer = timeInvincible;
    10.             animator.SetTrigger("Hit");
    11.             Instantiate(HitParticle, rigidbody2d.position, Quaternion.identity);
    12.          
    13.  
    14.         }
    15.         if (amount > 0)
    16.         {
    17.             Instantiate(EatParticle, rigidbody2d.position, Quaternion.identity);
    18.         }
    19.  
    20.  
    21.         currentHealth = Mathf.Clamp(currentHealth + amount, 0, maxHealth);
    22.  
    23.         Debug.Log(currentHealth + "/" + maxHealth);
    This is of course, quite straight forward once you know it, but as a beginner, we don't know which ways we should be thinking yet. And when following the instructions, all it says is: "call Instantiate when it should happen". It doesn't tell you where or how to do it in the code, leaving the beginner stranded. This is made worse by the fact that the heavy code parts of the tutorial were many tutorials ago and not fresh in the mind.

    I am not hating on this tutorial, as it has taught me a lot, and I have enjoyed it on the whole! And I think the first 7 tutorials or so were very beginner friendly. Though increasingly I just find myself stuck on things that the tutorial makes seem obvious.

    My recommendation to fix this issue would be to always have the full script available at the end of the tutorial, incase you get stuck (and make sure the scripts are free from errors!). Then as you are going through the tutorial, have hand reminders like this: "If you get stuck, feel free to peek at our completed code at the end of this tutorial."

    A bit of a long post! I just wanted to offer some honest feedback to help improve the experience :) And still, especially considering this is a free tutorial, these are such valuable resources!
     
    skoondi and bsonofhalvor like this.
  5. bsonofhalvor

    bsonofhalvor

    Joined:
    Sep 19, 2019
    Posts:
    4
    I've been stuck on the same thing for the last week! I was trying to make a little sparkle effect when I picked up a health collectible. I've been trying to add the instantiate code to the healthCollectible script with no luck. Which script did you add the public ParticleSystem variables to? I would think you add them to the item or the robot and then call them in the RubyController script? Not too familiar with public variables in C# myself. If you were to add a public ParticleSystem variable called EatParticle to the robotController script, can you just freely use that within another script as if it were a local variable?
     
  6. bsonofhalvor

    bsonofhalvor

    Joined:
    Sep 19, 2019
    Posts:
    4
    I suppose I could do some testing myself but I'm at work and don't have Unity on my work computer haha
     
  7. bsonofhalvor

    bsonofhalvor

    Joined:
    Sep 19, 2019
    Posts:
    4
    I tried this and it still didn't work for me. All of my code runs fine with no errors or flags yet the dang particles just don't appear.
     
  8. ErisCinder

    ErisCinder

    Joined:
    Jun 8, 2019
    Posts:
    3
    The issue I am having is that Ruby jitters when I click Play. She moves fine most of the time but because of the jitter she gets buggy sometimes. This has been driving me nuts, I have read the tutorial several times to see if I missed anything but I am not able to figure it out. Please help!

    https://www.dropbox.com/s/omslvwur9sj71kc/20191006_150145.mp4?dl=0
     
    Last edited: Oct 6, 2019
  9. ErisCinder

    ErisCinder

    Joined:
    Jun 8, 2019
    Posts:
    3
    I am having the same issue.
     
  10. scottsen11

    scottsen11

    Joined:
    Oct 11, 2019
    Posts:
    1
    ProBuilder 4.0 ships as verified with 2019.2 and is our unique hybrid of 3D modeling and level design tools, optimized for building simple geometry but capable of detailed editing and UV unwrapping as needed.

    PolyBrush is now available via Package Manager as a Preview package. This versatile tool lets you sculpt complex shapes from any 3D model, position detail meshes, paint in custom lighting or coloring, and blend textures across meshes directly in the Editor. shareit apk
     
    Last edited: Oct 24, 2019
  11. loopywolf

    loopywolf

    Joined:
    Oct 30, 2013
    Posts:
    1
    This tutorial is BAR NONE the best, most useful, most easy to follow unity tutorial for 2D I have ever found. I love the format, I love that it is text not video. Are there more? I want more tutorials just like this!
     
    Bistou1 and Valjuin like this.
  12. gdewaele

    gdewaele

    Joined:
    May 17, 2016
    Posts:
    4
    I just installed unity and have been trying to do the Ruby's Adventure 2D tutorial. But step one tells me to find the project in Unity hub (which I did), but then there is no button there to "Download project" like the tutorial says. When I hoover over the white space next to "View tutorials", there is an interactive element there, but with white text (I assume), and clicking there doesn't do anything.

    Can anyone help me? Reinstalling Unity didn't work.

    Thanks!

    Knipsel.PNG
     
  13. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    3,446
    Clicking on "View Tutorials" should open the right page. There is nothing to download in Unity right away; you'll have one or two files to download once in a while during each lesson.
     
  14. gdewaele

    gdewaele

    Joined:
    May 17, 2016
    Posts:
    4
    Thanks for your fast response! However, when I start following the tutorial on that page, the second step actually tells me to go download the project and open it. https://learn.unity.com/tutorial/se...66dbedbc2a0021b1bc7c#5c7f8528edbc2a002053b413 So I'm stuck in a loop :(

    Or is there a way I can download the project somewhere as a file?
     
  15. Shalindor

    Shalindor

    Joined:
    Oct 13, 2019
    Posts:
    3
    Hm wanted to start fresh with this tutorial but i am stuck at the same point as
    gdewaele

    The project list showed it has already been downloaded but the "Open project" link is grayed out.
    On second try when clicking on the project in the list to bring up the dialog, below pops up a message line saying
    "You need to install Editor version 2019.1 to open this project"
    That is a little annoying, why downgrading to use this?
     
  16. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    4,645
    Because Unity versions are different. This tutorial made with 2019.1 in mind. When you've learned enough and you can update a project between versions you can open it in a newer Unity and fix the differences. Not to mention that different versions of Unity could look like little bit differently and it can be misunderstood.

    General rule for tutorials: always follow along in the same version of Unity as the tutorial shows/expects/requires. Otherwise you will be lost, you will misunderstand what the tutorial wants to teach you.
     
  17. Shalindor

    Shalindor

    Joined:
    Oct 13, 2019
    Posts:
    3
    I know versions are different 2019.1 is clearly another version number then 2019.2, but in most cases there is a thing called backward compatibility. Seems like the changes in 2019.2 were too heavy to hold up compatibility to older 2019.1

    Is it possible to install the Editor 2019.1 side-by-side with 2019.2 ?
     
  18. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    4,645
    Yes it is. You have Unity Hub just go to the Installs and install whichever versions you need and whatever empty space you have on your drives.
     
    Shalindor likes this.
  19. Shalindor

    Shalindor

    Joined:
    Oct 13, 2019
    Posts:
    3
    Thank you, i will do :=)
     
  20. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    3,446
    The download button is there in the Hub, maybe you just need to try again. :)
     
  21. indys

    indys

    Joined:
    Jul 16, 2017
    Posts:
    11
    Hi, I searched this forum to see if anyone has anyone made a Game Over scene for when Ruby runs out of health, but nothing came up. If someone has any guidance on the code required for that, it would be appreciated. Thanks in advance.
     
  22. PBarone

    PBarone

    Joined:
    Oct 13, 2019
    Posts:
    13
    I am having a problem with the following instructions:

    2.
    Import Assets into your Project


    This Project is called Ruby’s 2D Adventure because the main character is called Ruby, and you’re making a basic adventure game in a 2D environment. You get the idea. So let’s find Ruby!


    1. Save the following image on your computer by downloading it from the Tutorial Materials at the top of this tutorial.

    XXX I don't see where it says to download Tutorial Materials at the top of the tutorial.




    XXX I right-clicked on the above image (.png). I pasted it into Art > Sprites.

    2. Drag and drop the file into Art > Sprites, so that Unity copies it into your Project folders and imports it with the default settings.

    3. Because your Project was created with the 2D template, the image is automatically imported as a Sprite. To see this, select Ruby in the Project window and look at the Texture Type field in the Inspector:

    XXX The Texture Type is Default, NOT Sprite (2D and UI)

    3.
    Use a Sprite to create a GameObject


    To use the Ruby Sprite to create a GameObject:

    1. Click on the small arrow next to the Ruby image in the Project folder. You will see that it “contains” what appears to be the same image, which is in fact the Sprite that Unity created for you.

    XXX There is no small arrow next to the Ruby image in the Project folder.

    2. Drag that Sprite from the Project window to the Scene view, to add it as a new GameObject to your Scene. Use the 2D view.

    XXX I can not drag the Sprite onto the Scene view.

    XXX When I dragged the Assete > Art > Sprites > Characters > Ruby Sheet onto the Scene View and attached the script to make it move, the sprite does not move after I hit Play. It animates, but does not move.
     
  23. Valjuin

    Valjuin

    Joined:
    May 22, 2019
    Posts:
    178
    upload_2019-10-19_22-29-42.png
    upload_2019-10-19_22-31-31.png
     
    Last edited: Oct 19, 2019
  24. indys

    indys

    Joined:
    Jul 16, 2017
    Posts:
    11
    Okay, it works now, but no idea if I did it right.

    Here's what I did.

    1) I made a new empty game object and named it Button Manager.
    2) I made a new script also named ButtonManager & attached it to the Button Manager game object.
    3) I created 4 new scenes: a Splash scene, a How To Play scene, a Game Over scene, and a You Won scene.
    4) I made buttons on each of these new scenes (such as 'Click here to play").
    5) In the ButtonManager script, I made methods to control the loading of each scene.
    5) On each button, in the On Click section in the Inspector, I clicked the plus sign and added the Button Manager prefab, and selected the method I needed the button to access (such as 'LoadStartScene').

    6) For the specific need I had (when Ruby's health is at 0, trigger the Game Over scene), I made this method and coroutine inside my ButtonManager script:

    Code (CSharp):
    1.  public void GameOver()
    2.     {
    3.         StartCoroutine(WaitToLoad());
    4.      }
    5.          
    6.     IEnumerator WaitToLoad()
    7.     {
    8.  
    9.         yield return new WaitForSeconds(2);
    10.         SceneManager.LoadScene("You Lose");
    11.  
    12.     }
    In the RubyController script's ChangeHealth method, I added this:
    Code (CSharp):
    1. public void ChangeHealth(int amount)
    2.     {
    3.         if (amount < 0)
    4.         {
    5.             if (isInvincible)
    6.                 return;
    7.  
    8.             isInvincible = true;
    9.             invincibleTimer = timeInvincible;
    10.         }
    11.        
    12.         currentHealth = Mathf.Clamp(currentHealth + amount, 0, maxHealth);
    13.  
    14.        [B] if (currentHealth <= 0)
    15.         {
    16.          
    17.            
    18.             FindObjectOfType<ButtonManager>().GameOver();
    19.          
    20.         }[/B]
    21.         Debug.Log(currentHealth + "/" + maxHealth);
    22.         HealthBar.instance.SetValue(currentHealth / (float)maxHealth);
    Now, when Ruby's health is at 0, the You Lose scene appears after a 2 second delay.

    It works well, just not sure if this is the way to do it.
     
  25. Myki_Chen

    Myki_Chen

    Joined:
    Oct 5, 2019
    Posts:
    5
    Hi,I‘ve got a problem in the part of “World design-Tilemap”. I can’t find the Tile option when I want to create ia new Tile. I used the newest version 2019.2
     
  26. indys

    indys

    Joined:
    Jul 16, 2017
    Posts:
    11
    In your Tiles folder, try right clicking > Create > Tile (should be about halfway down the list).
     
    Myki_Chen likes this.
  27. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    3,446
    Have you installed the package?
     
  28. Myki_Chen

    Myki_Chen

    Joined:
    Oct 5, 2019
    Posts:
    5
    Oh ~is not installed default?????
     
  29. Myki_Chen

    Myki_Chen

    Joined:
    Oct 5, 2019
    Posts:
    5
    Yeas,but still no Tile option there
     
  30. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    3,446
    Myki_Chen likes this.
  31. Myki_Chen

    Myki_Chen

    Joined:
    Oct 5, 2019
    Posts:
    5
  32. Myki_Chen

    Myki_Chen

    Joined:
    Oct 5, 2019
    Posts:
    5
  33. NobleSkeleton

    NobleSkeleton

    Joined:
    Sep 7, 2019
    Posts:
    1
    Hello. I'm stuck in the World Interactions - Dialog Raycast section of the tutorial. In part 6, Displaying Dialog, it says: "10. Don’t forget to assign the Canvas child of Jambi in the “Dialog Box” setting in the NonPlayerCharacter script in the Inspector." However, it won't allow me to drag/drop the canvas from the hierarchy to the "Dialog Box" section in the inspector. Nor can I select it by clicking the little circle. I'm in 2019.1.14f1. Thanks!
     
  34. PBarone

    PBarone

    Joined:
    Oct 13, 2019
    Posts:
    13
    The instructions in the Ruby's Adventure Tutorial say:

    The Tilemap doesn’t directly use Sprites, it uses Tiles. To create a new Tile:


    1. In the Project window, go to Assets > Art.


    2. Right-click within the folder and select Create > Folder. Call your new folder “Tiles”. 3. Double-click Tiles to open the folder.


    4. Right-click within the folder and select Create > Tile. In the dialog box, call this Tile “FirstTile” and save it.

    ***When I right-click within the folder and select "Create", there is no option for "Create > Tile".
    see attachment. No tile.jpg
     
  35. PBarone

    PBarone

    Joined:
    Oct 13, 2019
    Posts:
    13
  36. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    3,446
    What version of Unity are you using? Maybe you need to deinstall it and install it anew.
     
  37. valyth

    valyth

    Joined:
    Oct 12, 2019
    Posts:
    3
    From section 12.7, I simply cannot get the smoke to stop when the robot is fixed.

    public ParticleSystem smokeEffect; has been added to my EnemyController script, and smokeEffect (Particle System) is now correctly listed under the new Smoke Effect setting in Inspector.

    I added smokeEffect.Stop(); to my Fix function, but while the the animator plays the Fixed animation and the robots "Fix", the smoke effect does not stop. I'm at a loss. I deleted it and started all over again, but I still get the same problem.

    I also tried out the Destroy(smokeEffect.gameObject) code to see if that helped, but it actually results in a unity error when you fix the robot:

    Destroying assets is not permitted to avoid data loss. If you really want to remove an asset use
    DestroyImmediate (theObject, true); UnityEngine.Object:Destroy(Object) EnemyController:Fix() (at Assets/Scripts/EnemyController.cs:85) Projectile:OnCollisionEnter2D(Collision2D) (at Assets/Scripts/Projectile.cs:26)


    I tried simply pasting the script from the "Check your script" section in case I messed something up, but that did not help, so this does not appear to be a code error as far as I can tell.

    This is all in 2019.2.10f1. Does anyone have any ideas? Thank you.
     
    Last edited: Oct 30, 2019
  38. valyth

    valyth

    Joined:
    Oct 12, 2019
    Posts:
    3
    I was able to backread a little and find a solution. Specifically, the smokeEffect that you attach to the Enemy Controller "Smoke Effect" in inspector cannot be dragged or selected from your Prefabs, but must be from the hierarchy under your bot itself when you're editing the Bot prefab. Someone made this handy video to show how.

    I strongly recommend calling this out in the Tutorial.
     
    lkkozlowski likes this.
  39. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    3,446
    What is this figure about under the title on the top of the tutorial?

    Capture.JPG
     
  40. danilofe

    danilofe

    Joined:
    Oct 30, 2019
    Posts:
    1
    Thank you very much, I had the same problem
     
  41. skoondi

    skoondi

    Joined:
    Oct 13, 2019
    Posts:
    1
    Really enjoyed this tutorial! I do agree with some of the other comments about giving a little more help for those who are learning to program, particularly in the particle effect section, the completed scripts with health and hit particle systems would be a nice addition so that people can check their solutions.

    So I've built the game and been playing around with shooting diagonally which works fine with the arrow keys and also fine with WASD except when I try to shoot diagonally down forward with SD, could just be an issue with my keyboard, curious if anyone else has the same problem?
     
  42. RaltSh

    RaltSh

    Joined:
    Nov 8, 2019
    Posts:
    1
    Never mind! I gave up and started from scratch and now the colliders are where they should be. No idea what I did differently.



    I'm having issues with Colliders, that being that they are always offset. I've tried re-creating the metal box prefab three times now, and the collider is never on the sprite itself. I added a collider to a tree, and it also is offset, adding an invisible box I cannot pass through nearby the sprite.


    Recording:

    (Shows my colliders, and then I move my character through the sprite, and then show you where the collider actually ended up, ramming into it over and over)
     
    Last edited: Nov 8, 2019
  43. marcus_cheong4

    marcus_cheong4

    Joined:
    Nov 4, 2019
    Posts:
    3
    I am stuck at the Camera Cinemachine tutorial step where we need to change the Cinemachine Virtual Camera setting of Orthographic Size from 10 to 5.

    " To zoom-in again, look at your vcam Inspector for a property in the Lens section called Orthographic Size and set it to 5 instead of 10"

    The tutorial picture looks like this:

    upload_2019-11-9_14-57-0.png

    But when I followed the instructions, mine shows field of view:

    upload_2019-11-9_15-3-26.png

    Is this a bug and if so how do I solve this. I am a beginner to Unity. Using Cinemachine 2.3.4 and Unity 2019.2.11.f1
     

    Attached Files:

  44. Valjuin

    Valjuin

    Joined:
    May 22, 2019
    Posts:
    178
    Same Unity Version and Cinemachine Version works for me (see screenshot):

    upload_2019-11-9_18-49-9.png

    You could try deleting the CMvcam1 from your hierarchy and adding another one to see if that gives you the correct lens parameter.

    I know that this was an issue that was reported as being fixed (see link):

    [Question] Virtual Cameras, "Orthographic Size" and "Field Of ...https://community.gamedev.tv › Unity Courses › Ask
     
  45. marcus_cheong4

    marcus_cheong4

    Joined:
    Nov 4, 2019
    Posts:
    3
    Still no difference after doing what you told. I believe because your computer is using Mac OS version of Unity while mine is the Windows version of Unity
     
  46. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    3,446
    This happens because your camera is set to "Perspective" instead of "Orthographic". Set your camera to "Orthographic" and you'll be able to change the orthographic size.

    You must verify that you did everything correctly before reporting a problem. The part where it's said that your camera must be set to "Orthographic" is described in the Camera - Cinemachine tutorial, part 3 "Camera Modes": https://learn.unity.com/tutorial/camera-cinemachine?
    Capture.JPG
     
    Valjuin likes this.
  47. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    3,446
    @JacekPapaPolski I think I've already read about what I'm about to post but I'm not entirely sure.

    About the Audio tutorial, chapter 8 "Fixing Attenuation", most of it work except that having the 3D volume rolloff set to "Logarythmic" makes the sound inaudible, even after setting the maximum distance to 999.

    On the other hand, switching to "Linear" with a maximum distance of 10 as mentioned in the tutorial makes the sound barely audible as well. Keeping the maximum distance to 20 is a good compromise for me.

    Note: I'm making this tutorial with 2020.1.0a12 but I don't think it makes a lot of difference compared to 2019.2.

    Anyway, you guys did a very good job with this tutorial. :)
     
  48. marcus_cheong4

    marcus_cheong4

    Joined:
    Nov 4, 2019
    Posts:
    3
    Ok Thanks. I saw the line you were mentioning.

    "Note: The camera was already automatically set to orthographic when you created your Project with the 2D Template."

    I had assumed that was already done. Thank you for clarifying and helping. Also thank you to everyone who tried to help me.
     
  49. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    3,446
    Never assume, never take anything for granted. :)
     
    Valjuin likes this.
  50. Valjuin

    Valjuin

    Joined:
    May 22, 2019
    Posts:
    178
    Because the camera was already automatically set to orthographic when I created my project with the 2D template, I, too, just assumed :oops:
     
unityunity