So depressive and unmotivated

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. :frowning:

1 Like

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 Likes

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 :wink:

1 Like

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.

2 Likes

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.

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.

2 Likes

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.

1 Like

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 :smile:)

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:

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

public partial class Digits1 : MonoBehaviour
{
    const float DefaultVerticalScrollSpeed = 2.0f;

    public TextMesh textMesh;

    public float Lifetime = 1.0f;

    Vector3 velocity;
...
}

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:

public class FloatingMessage : MonoBehaviour
{

 
    // 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.
    const float VerticalSpeedDefault = 3.0f;

    // define how long the message lives before disappearing
    public float timeToLive = 1.0f;

    // define a variable we will need later to define the direction in which the text goes floating away
    private Vector3 velocity;
 
    // reference to the FloatingMessage prefab's textmeshpro component - we will need this reference in order to change the text properties later
    public TextMeshPro textMeshPro;

...
}

And so on - I go through the whole thing like this. In some cases I might rename entire methods, like :

public void Apply(int damage) {
Health -= damage;
}

I might change this as I rewrite it to

public void RemoveFromHealth(int amount) {
// this method removes the given amount from the Health variable
Health -= amount;
}

… 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.

1 Like

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.

1 Like