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. Dismiss Notice

So depressive and unmotivated

Discussion in 'Getting Started' started by real2Soulz, Apr 4, 2021.

  1. real2Soulz

    real2Soulz

    Joined:
    Jan 14, 2021
    Posts:
    1
    I keep forget what i learn in unity coding tutorials. I know some words for code but always forget when yo use them.
    I can write some code words simmilar like public private without looking. I cant code anything in the challanges and write the same code others wrote. I am so sad and depressive. I really want to program and it makes fun but then again i do this because i keep forgetting etc. :(
     
    BrandyStarbrite likes this.
  2. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,553
    Hi and welcome,

    Here are a few tips that might or might not help.

    Try to set realistic goals for your learning to avoid frustration. Avoid comparing yourself to others, instead try to focus only on what you are trying to learn. When practising, work with things you think you got some grasp of. And try to actually make something - make changes, try to add a feature and in process you will probably break whatever you were working on. Then try to to fix it. And repeat that enough many times so that the things start to stick to your head. Remembering abstract things is not easy, and you can't expect it to happen with one try.

    And for learning C# syntax, Unity tutorials might not be the best idea. Of course you need to learn many things that are needed in Unity, but I would suggest checking sites like Dot Net Perls and try to practice things that are needed in C# programming. It might be a good idea to do some C# course you can find online.
     
  3. aMIGA_dUDE

    aMIGA_dUDE

    Joined:
    Oct 12, 2019
    Posts:
    21
    Keep trying. But you might not have an mind for C# scripting. Don't threat, Visual Scipting might be better suted for you.

    For myself I can not get head around Visual Scripting but get C# so much easer.

    Anyway who cares if you work in Unity is coding using Text or Visual? What matters most of all that you create your own enjoyable titles.



    PS if this helps you out send me free key of first game on steam ;)
     
    BrandyStarbrite likes this.
  4. kmo86

    kmo86

    Joined:
    Dec 15, 2020
    Posts:
    104
    Use tutorials and then try to complete them again without using the tutorial. Only try to learn 1 or 2 different things at a time. Check out the create with code tutorials in the learn section. These start at the very basic move code then get more in depth and they tell you exactly what to type and where to type everything. At the end of each tutorial there is a challenge to test what you have learnt and if you get completely stuck you can get the answers how to code each part on internet. Also keep doing games and using tutorials to add extra bits. In the create with code tutorials you learn how to add game over screen, restart button and difficulty levels so try to add them in other games you have done. The more you use same code the easier it will be to remember it.
     
    stain2319 and Peeter1978 like this.
  5. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    I'm not a big tutorial fan. People learn better by through trial and error than by duplicating someone else's work, which is what a tutorial essentially has you do.

    Come up with a simple prototype project, and try to get it done. Feel free to refer to tutorials with relevant information, but don't just duplicate a tutorial project. You'll remember what you learn this way a lot longer.

    Plus you'll feel some level of accomplishment when you get it working.
     
  6. stain2319

    stain2319

    Joined:
    Mar 2, 2020
    Posts:
    419
    I feel this post my friend. I'm doing pretty well on my learning path and almost have a simple game completed (a combination of trivia game and endless runner), and as I start to think about my next project I want to make something a bit more complex. But as an indie (hobbyist) developer it is really overwhelming sometimes. There is soooooo much to learn.
     
    Joe-Censored and Peeter1978 like this.
  7. max3210

    max3210

    Joined:
    Apr 19, 2020
    Posts:
    17
    I'd suggest making notes on what you've learned, that's what I do.

    Also, when you're new to learning Unity it's a lot of hard work and effort. But once you get past this initial learning curve, it gets easier and becomes more fun.
     
    stain2319 likes this.
  8. stain2319

    stain2319

    Joined:
    Mar 2, 2020
    Posts:
    419
    I wanted to add another tip which has helped me immensely as a beginner coder. I have dabbled in coding for a long time, and in my day job I do some minor coding/scripting (mostly in SQL and LUA) but it's not something I sit down and do for hours every day... but recently I have made the commitment to spend more time in C# and Unity and really get to know some of the common patterns and use cases for game programming (mostly as a hobby as my day job pays pretty well already :D)

    Anyway - one thing that has helped me in the past few weeks to make a lot of really good progress is to take someone else's code, and re-write it into a new script, while changing some of the methods and variable names and writing comments on each line explaining (to myself) what is going on.

    For example I have been working on a Floating Text issue today with the help of @Kurt-Dekker who provided a package in this thread:

    https://forum.unity.com/threads/nee...-values-pre-instantiated-during-live.1070738/

    Just to give a small snippet of what I am talking about, here is some of his original code:

    Code (CSharp):
    1. public partial class Digits1 : MonoBehaviour
    2. {
    3.     const float DefaultVerticalScrollSpeed = 2.0f;
    4.  
    5.     public TextMesh textMesh;
    6.  
    7.     public float Lifetime = 1.0f;
    8.  
    9.     Vector3 velocity;
    10. ...
    11. }
    12.  
    So I put this up in Notepad++ on a second monitor and have Visual Studio open with my "FloatingMessage.cs" open on the main display. And I start "translating" the code like this:

    Code (CSharp):
    1. public class FloatingMessage : MonoBehaviour
    2. {
    3.  
    4.  
    5.     // define the default vertical speed for the object - this is a constant so we can't programatically change it, all instances of the class will have the same default speed.
    6.     const float VerticalSpeedDefault = 3.0f;
    7.  
    8.     // define how long the message lives before disappearing
    9.     public float timeToLive = 1.0f;
    10.  
    11.     // define a variable we will need later to define the direction in which the text goes floating away
    12.     private Vector3 velocity;
    13.  
    14.     // reference to the FloatingMessage prefab's textmeshpro component - we will need this reference in order to change the text properties later
    15.     public TextMeshPro textMeshPro;
    16.  
    17. ...
    18. }
    And so on - I go through the whole thing like this. In some cases I might rename entire methods, like :

    Code (CSharp):
    1. public void Apply(int damage) {
    2. Health -= damage;
    3. }
    I might change this as I rewrite it to

    Code (CSharp):
    1. public void RemoveFromHealth(int amount) {
    2. // this method removes the given amount from the Health variable
    3. Health -= amount;
    4. }
    ... you get the idea, I think. I find that the combination of re-typing the code, but giving more "descriptive" (if longer) variable and method names, and commenting every line to explain "here is what this line does" really helps me solidify my understanding.
     
    Kurt-Dekker likes this.
  9. stain2319

    stain2319

    Joined:
    Mar 2, 2020
    Posts:
    419
    One thing I forgot to mention about the above is that as soon as you run into a line of code where you find that you can't write a comment explaining it, you go look that up and learn about it until you can come back and go "aha, now I see!" and write said comment. I learn a ton this way.
     
    max3210 likes this.