So I know that you’re supposed to learn a programming language before you can dive right in to making a game, I get that. I am already about 3/4 through learning Javascript, and most of it is making sense to me. The one thing I am having 100% trouble with is simply writing scripts from scratch. Okay, lets say I wanted to, for example, make a simple sprinting script. I know a lot about the language javascript, but none of the knowledge would help me to actually start writing a script to sprint. Would I need to learn EVERY single term that Unity uses to program? This one simple problem has stumped me for so long, and no place on the internet, not even programming tutorials, tells me how to do this. Someone please enlighten me.
moving a character would be something like this :
if (Input.GetKeyDown(“w”))
transform.Translate(Vector3.forward * Time.deltaTime);
You don’t need to know everything, just to search everything you need when you need it.
There are tutorials on the unity website.
Just click “learn” > “tutorials” > projects
And also check in the asset store > complete project section
the 3D platformer tutorials.
This will get you going
I’m on the C# boat, and i would not say I know EVERY single thing about it, and I think the best days I’m programming is days where i learn some thing new. If you want to get started, rather than jumping right into the engine, try to make some stand-alone apps/programs in the language, even that UnityScripts (so called javascript) does not exist in the exact same outside unity, which is another reason I recommend learning C#.
If you want to write some simple scripts for training/getting started here is a few task:
Make the debugger say stuff
Initialize 10 or more game objects randomly using a loop
Make an object come to live by make it move around
Make a Name generator
Play with inheritance by having a base class you can use for your player and an inheritance class for AIs
Imagine… Create… Enjoy!
You just have to practice. Start with simple stuff, and learn more as you go. Break problems down into steps, and go through each step logically.
–Eric
Whoever said you need to learn programming before making games is a silly person. You are supposed to learn programming before taking on a “big” game, sure, I agree. But you also need to make software to learn programming, and that program can be a game of course. I don’t even understand how you can learn programming without making at least a script that applies what you just learned and just prints out a value into the console.
I think “not even programming tutorials” is your problem. If you know how to assign variables, compare them and make loops you’re good to go. You need to check out “unity tutorials”. Unitys own tutorials are great for basic stuff. You need to understand what a Gameobject, a Transform, a Component is and how to reference them in code. Then try to make a script that you can assign to a cube, and make it constantly move in a direction. Don’t know how to move the Transform? Well check out the reference. I already found the class for you. See anything helpful in there that could help modify the position? Click on in for a code example. Then make it move only if a button is pressed. Tutorials will help you find the Input class. And well, go from there
Get a tutorial book / website and work through a project with them. The difference a small investment like that will do is pretty big. Learn gameMath (get a book if you don’t study basic stuff like this in school) so you can create your own solutions to new problems rather than NEEDING stock solutions. But if a stock solution exists to a complex problem evaluate whether you should use it or make it yourself. For 2D , for example, creating your own sprite solution is a waste given the awesome solutions on the asset store. Not getting overly frustrated remaking the wheel helps keep you motivated. My 2 cents is also learn C# it’s the most supported Unity language, an excellent programming language, and the jump to C and C++ isn’t as bad if you ever go there. Not only that looking through the scripts from the asset store will teach you alot about good programming and how to do things that you wouldn’t figure out yourself.