Im new to both coding and Unity but I really want to make a basic Tower Defense Game in Unity and a friend is on my “team” with me and he is making 3d models in Blender to go with the project and were both just starting new and want to learn.
As far as learning goes, I have followed many tutorials both from this site and from various other sites but each one just shows me how to make game X. For example one tutorial showed me how to make a 2d space shooter and another showed me how to make a 3d platformer.
I was wondering if anyone knew where I could go to help get some advice on how to make a simple Tower Defense and then I can mess around and make it more advance later on?
I would really appreciate it and thanks for reading this post and replying.
Start small and make stuff from the tutorials. Scripting is just pasting together different commands for a result. Nobody is going to just give it to you, you have to work for it.
I will give you your first code to remember.
var enemy : transform;
Var speed = 30;
function update(){
Vector3.Lerp(transform.position, enemy.position, speed * Time.deltaTime);
}
what it does:
it will move one object to the enemy!
Usage:
put it on the thing that moves. And in the inspector, put in the enemy for the variable enemy. Then chooose a speed.
I hope that helps. It was the first thing I ever learned that actually did something.
Sorry if I sound grumpy, but it’s called using your head, mate. You’re not going to find a tutorial online showing you how to create your game, exactly how you want it. Using the information from those tutorials, you should be able to create a basic outline of your game.
If you can’t, then read more documentation. Begin with really simple stuff. For example, begin scripting enemies that move towards the castle. Begin scripting health, etc. Just start hacking away at the most fundamental things, and sooner or later, you’ll have yourself a game.
Sounds to me like he’s asking for another tutorial.
Like already mentioned if you’re depending on finding a tutorial on how to make your game before you can begin you will never succeed, but if you’re able to piece together what you’ve learned in the other tutorials then you’ll get somewhere.
First of all the framework of a tower defense game is extremely simple and you should have everything you need in the “make game x” tutorials already here on this site.
You’ll need some path finding, but to keep things simple you can make the enemies follow preset paths. For this you can more or less just take the waypoint script of the first person shooter tutorial straight into your tower defense game.
And you’ll need towers that shoot your enemies. For this you can take the sentry gun script from the same tutorial and place it on your towers and change firing effects, projectiles etc. for the different tower types.
And then you just place a trigger at the end and subtract a life every time an enemy reaches your trigger. For enemy waves I think I have posted my wave script in my showcase thread on this forum which is just a simpler version of the wave script Spk originally posted in his thread.
And you need to create some arbitrary script for placing towers along your path, but I’m sure that’s covered many times here on the forum or in the wiki.
With those things you should actually have a working tower defense game in no time at all. Then you can start tweaking, expanding, maybe even trying to put in some proper path finding so you can place towers wherever you want, adding some code to allow upgrading of towers etc.