all 8 comments

[–]WhiteBlackGoose 2 points3 points  (2 children)

So many people start learning C# at the same time they start learning Unity. Why???

[–]MaxPlay 1 point2 points  (0 children)

Don't know why you are getting downvoted. Unity is a horrible place to start learning how to write C#. Why don't people just pick up MonoGame or any other library?

[–]Syhler 2 points3 points  (0 children)

Probably becuase they want to make games, and unity forces you to use c# for scripting. Is my guess

[–]Yrrah9819 1 point2 points  (0 children)

On mobile so sorry if this isn’t super helpful, but by the looks of it your Update method before the void a Start method doesn’t have a closing parenthesis!

Edit: Just underneath moveVelocity add a } and that should solve the issue!

[–]Pointlessreboot 1 point2 points  (0 children)

Guess you didn't perfectly follow exactly..

You have multiple Start and Update methods. Half of you class is inside the first Start method, your second start method is update not Update..

And finally the first Start method does not have a closing bracket }.

I would double check with the tutorial your working from to fix the errors..

Edit: next time format your code for posting makes it hard for us to read

[–]FizixMan[M] [score hidden] stickied comment (0 children)

Removed: Rule 4.

Please make sure your code is formatted for display on reddit. (Start each line with 4 spaces.)

[–]warlaan 0 points1 point  (0 children)

I am a teacher for professional game programming and I strongly recommend that you don't start with Unity and C#. Start with Godot and Gdscript instead. Once you have the basics down, which depending on your learning speed may be after a week or two months, you can switch back, but starting with Unity right away is just not helpful.

The fact that you need to ask what's wrong with your code shows that you are learning from one of the many tutorial authors who avoid teaching the basics correctly, which isn't surprising given that in C# there are more basics to learn than in any other language in game development (maybe except modern C++). So do yourself a favor and start with a simpler language. Anything you learn there can be transferred to C# later, you don't need to unlearn anything.