- Home /
How to start scripting?
I have been using unity for almost a year now. I have learnt all the basic stuff and I have been watching some beginner tutorial series like Tornado Twin's and Burgzergarcade's videos.
But now I would like to begin making my own games instead of just copying those tutorials. I already have tons of useful ideas in my head, but right now my biggest problem is how to get started with scripting. I already have a wide collection of scripts from the tutorials, but I would like to make my own scripts from scratch.
Here's an example:
I want to make a simple 3rd person shooter. I have models for my character, weapons and enemies. Then I need a script to control my character, camera behaviour script, weapon control script, AI script and so on...
How to get started with all this? Should I just learn more and more Javascript from tutorials until I am experienced enough to write a script from scratch? Do you have any good tips for scripting? How did you guys learn writing codes?
Please help me!
Answer by GesterX · May 12, 2011 at 04:22 PM
A 3rd person shooter is not a simple first project. It's good that you've done a lot of tutorials but you need to make sure you've UNDERSTOOD them too.
So for example how about something like space invaders. You should be able to build that without too much trouble. Just think of the things you need:
- A player object that moves left and right
- A way to make the player shoot
- Some enemies that move in a pattern towards the player
- Scripts for score/time/health
- You can add a menu/music/difficulty
If you can do something like this then you know you're heading in the right direction. Following tutorials is great for learning but what's better is applying the techniques you've learnt and problem solving (LOTS of problem solving).
Make sure you become good friends with the scripting reference. You'll spend a lot of time in their figuring out the best functions/classes to use.
Oh and if you get stuck - no matter how simple the problem/bug then the helpful folks here are more than willing to point you in the right direction
Hope this mass of information some what helped you :-)
EDIT: One final thing - check out http://www.unity3dstudent.com/category/modules/ for lots of mini lessons on all of the basics (and a few advanced things). The tutorials there are great because they explain how to use a single function in an easy to understand way!
Thanks for your help! Now I'm gonna take a little closer look to the scripting reference and that website you pointed out and maybe start making some kind of space shooter :D
No problem. Definitely start with something simple - you'll soon realise that there are hard parts to every project! I would reccomend just getting stuck in. Figure out how to make the player move and shoot. How to make the enemies move. How to make bullets kill the enemy etc...