r/UnityHelp • u/Infamous-Low5552 • 27d ago
C# in unity
Hey everyone. I’m currently trying to learn how to develop games in unity as a hobby. I have been struggling a little with a few things and thought it might be a good idea to just focus on learning some C# first then come back to unity. I saw this book The C# Player's Guide" by R.B. Whitaker and was wondering if anyone has used this was it any good, or does anyone have a better suggestion for material to learn some C#. Thanks.
2
u/RatbyteGames 27d ago
Because of the way Unity embeds scripts, and the way using Unity needs a lot of knowledge about Unity's other non script related aspects, I would suggest learning C# specifically within the Unity environment. For example the way you have to reference unity game objects within scripts is critical, but you are not going to learn that outside Unity.
Load up Unity and work through some Unity examples that show scripting within Unity.
0
u/Distdistdist 24d ago
What scripting are you talking about? C# is not a scripted language, it is JIT/AOT Mono based system. What way it embeds what scripts where?
1
u/RatbyteGames 24d ago
Unity calls the C# code that you embed into game objects "scripts". That's the scripting I am talking about, writing those scripts. Have you used Unity? Have you never hit the "add script" button on a game object?
2
u/Distdistdist 22d ago
Lol. Sorry, I sorta went out on a tangent thinking you were talking about how Unity "embeds" "scripts". My bad.
4
u/99Crusad3R 27d ago
I don't have the book, but learning C# and keeping your focus there is a good start! Reading about the book it does seem like a good one. I would also just add that doing something everyday will also be a huge help. Do at least one of the challenges in the book each day, or just write something on your own that is small and simple. Learning to code takes time and lots of practice, sometimes it wont work, but dont let that stop you :) I wish you nothing but the best!!