Skip to main content
GameDev.net gamedev.net
🔒 Locked

scripting and unity3D

Started by Oliviero Nardi Jan 6, 2014 at 5:16 PM 11 replies 6.8k views
Original Post
Oliviero Nardi
Oliviero Nardi

Hi again people!

So yesterday I've asked here some informations about physics engines and how to write a game engine. After some research, I understood that for now it would be best to learn a bit how an engine works before trying to write my own engine. So, I've tried two engines: cryengine and unity3D. I didn't like cryengine, so I'll stick with U3D. I've understood some of the basic things and such, but now I'm stuck. I guess that to do all those fancy videogames stuff (like , I don't know, programming the AI?) You need always scripts, am I right? Well, my question is, where do I learn to use those scripts? Give that I can't use C# (but I know C++), is there a manual or something? Because while I'm able to code, I don't know how to make a script for unity. Any book or online tutorials on that? The more detailed the better.

edit: should I try UDK ? Which is more simple? Which is more beginner-like?

PragmaOnce
PragmaOnce

The projects on the unity page are quite nice to work through. The first one touches on some of the basic concepts and the third one goes into more advanced coding techniques.

http://unity3d.com/learn/tutorials/projects

There is also a manual that explains the theory behind unity concepts and a reference guide that can be used to check functions and search for a specific behavior etc.

http://unity3d.com/learn/documentation

Oliviero Nardi
Oliviero Nardi

Thank you! I don't know why I did not find that before. It also contains a stealth game tutorial! Perfect!

edit: may also ask: do I need to learn C#? Or is C++ enough?

PragmaOnce
PragmaOnce

Well, when I started with Unity I also only knew C++. You'll find that the syntax is almost exactly like C++. So instead of learning C#, do the tutorials and get familiar with the syntax but focus your efforts towards understanding the Unity API. Because the majority of your programming will be based on functions/variables that already exist within Unity.

Goodluck smile.png

Oliviero Nardi
Oliviero Nardi

Given your username and your excitement about the tutorials having a stealth project, I think I can guess what kind of project you'll be working on, taffer...

Oh yes you can!

brunopava
brunopava

There is also the Unity Youtube Chanel, wich contains a lot of video tutorials for both scripting and learning to work with the editor.

I suggest for you to watch some of the videos to learn the basic workflow for the engine.

Hope that helps.

CaseyHardman
CaseyHardman

Unity is more beginner-like than UDK (by far, in my opinion) and gives you a cleaner way to get code into your game.

All you need is to get good with C# and programming in general, and learn the Unity classes (GameObject and Transform are important). All you've gotta do is write a script and drop it on something in the game to get the code running.

I would suggest using Visual Studio C# Express or MonoDevelop to write your code. They have convenient features that will help you in the future.

Bookmark/favorite these pages, they're very useful to have around for when you need them:

  • This one for the search bar; it lets you search any class in Unity and see all of the methods and variables inside it
  • This one to find information about specific components and how to use them (such as colliders, rigidbodies, lights, etc.)
  • This one for whenever you need to configure your colliders/rigidbodies; it's helpful because at the bottom of the page it gives you a chart of which kinds of colliders will collide with others
  • This one for all you need to know about C# syntax

Also, since I believe you're programming a 3D game, you should know how Vector3's work if you don't already.

https://x.com/Casey_Hardman
jtobler
jtobler




I would suggest using Visual Studio C# Express or MonoDevelop to write your code. They have convenient features that will help you in the future.

I can also recommend SharpDevelop (http://www.icsharpcode.net/opensource/sd/) as a great free IDE for C#/.NET development.

Oliviero Nardi
Oliviero Nardi
Thank you guys! It really sucks that it isn't c++ compatible, though.
Nathan2222_old
Nathan2222_old

Thank you guys! It really sucks that it isn't c++ compatible, though.

Yeah. The only c++ engines i've seen are cryengine and leadwerks (between those 2, leadwerks even though it isn't free but it's cheaper than unity pro, last time i checked)
UNREAL ENGINE 4:
Total LOC: ~3M Lines
Total Languages: ~32

--
GREAT QUOTES:
I can do ALL things through Christ - Jesus Christ
--
Logic will get you from A-Z, imagination gets you everywhere - Albert Einstein
--
The problems of the world cannot be solved by skeptics or cynics whose horizons are limited by the obvious realities. - John F. Kennedy
kop0113
kop0113

If you are interested in the art side of this, then perhaps you can use the Thief III engine to create your game. There have been a few decent mods so far and the original developers have also provided the Thief 3 Editor (a modified udk 2.x editor). I think it even provides basic scripting facilities.

If you are interested primarily in the technical stuff and want to develop an engine with realtime shadows etc... for your game, then personally I wouldnt bother with products like Unity and suggest you go directly to OpenGL (or DirectX if you want to sacrifice portability). Not only will you find this more flexible, but you also can avoid some of the bagage required by Unity and other generic engines. ( .NET, Proprietary, etc...)

http://tinyurl.com/shewonyay - Thanks so much for those who voted on my GF's Competition Cosplay Entry for Cosplayzine. She won! I owe you all beers :)

Mutiny - Open-source C++ Unity re-implementation.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.