I've decided unity

Started by
13 comments, last by Gian-Reto 9 years, 8 months ago
I am right in thinking that C# can be used completely in Unity to create a project from scratch?

Meaning by using that I can just use code to create a game, instead of the copy/paste of items and such
Advertisement

I am right in thinking that C# can be used completely in Unity to create a project from scratch?

Meaning by using that I can just use code to create a game, instead of the copy/paste of items and such

You can do a lot in Unity with C#... if you know how.

Now, I am not sure what your question here really is.

If your question was if you have to use the editor:

Unity is just a tool that takes your input (scripts, 3D Objects, Sounds, ...) and builds an executable game out of it. How you structure your project, is completly up to you.

Of course, Unity was meant to be used with their Component-based architecture: You use the editor to create a level by placing 3D Objects, assign physics compoents, and in the end write behaviour scripts attached to the objects in the scene to get things moving.

But you don't have to. There are multiple people building their Unity projects in a completly different way.

For example some people will create scripts, or maybe even c++ Programs (yes, you can run them from a Unity script... You just can't open and change them in the Unity editor), that will generate stuff on the fly. They will place your mobs or other level objects, they might generate completly random levels, and so on.

Here, the code in the C# or Unityscript script or C++ Program will create the levels needed for the game, without creating them in the editor.

Of course the editor is still useful for some tasks. Importing 3D Objects and Textures for example.

If your question is if you can write everything or if you have to copy and paste:

Of course! That is the ultimate goal of every tool like Unity to give you the ability to write your own code and come up with original ideas nobody else has thought about.

But don't be afraid to use the occasional sprinkling of some copy-pasta code when you get stuck on a problem. Most professional programers are masters of the arcane arts of Google-Fu... its part of the secret to their awesome code (because to become good at something, you will need to learn from others first).

The good thing about an Engine with a huge community like Unity is: if you want to code away on your own, you can. If you get stuck and need to get some help, its always just around the corner.

If your question was just about the way you place Objects in the Scene in the Editor:

I think even in some of the most basic tutorials you will learn how to instanciate a prefab.

What "Instanciating a Prefab" means is: You have a preconfigured object (with physics, 3D Model, attached scripts) and place it somewhere in the running game.

How you create your prefab is up to you. Easiest is probably in the editor with drag and drop, you could of course also do this in code.

I am right in thinking that C# can be used completely in Unity to create a project from scratch?
Meaning by using that I can just use code to create a game, instead of the copy/paste of items and such


You can do a lot in Unity with C#... if you know how.


Now, I am not sure what your question here really is.


If your question was if you have to use the editor:

Unity is just a tool that takes your input (scripts, 3D Objects, Sounds, ...) and builds an executable game out of it. How you structure your project, is completly up to you.

Of course, Unity was meant to be used with their Component-based architecture: You use the editor to create a level by placing 3D Objects, assign physics compoents, and in the end write behaviour scripts attached to the objects in the scene to get things moving.

But you don't have to. There are multiple people building their Unity projects in a completly different way.

For example some people will create scripts, or maybe even c++ Programs (yes, you can run them from a Unity script... You just can't open and change them in the Unity editor), that will generate stuff on the fly. They will place your mobs or other level objects, they might generate completly random levels, and so on.
Here, the code in the C# or Unityscript script or C++ Program will create the levels needed for the game, without creating them in the editor.

Of course the editor is still useful for some tasks. Importing 3D Objects and Textures for example.


If your question is if you can write everything or if you have to copy and paste:

Of course! That is the ultimate goal of every tool like Unity to give you the ability to write your own code and come up with original ideas nobody else has thought about.

But don't be afraid to use the occasional sprinkling of some copy-pasta code when you get stuck on a problem. Most professional programers are masters of the arcane arts of Google-Fu... its part of the secret to their awesome code (because to become good at something, you will need to learn from others first).

The good thing about an Engine with a huge community like Unity is: if you want to code away on your own, you can. If you get stuck and need to get some help, its always just around the corner.


If your question was just about the way you place Objects in the Scene in the Editor:

I think even in some of the most basic tutorials you will learn how to instanciate a prefab.
What "Instanciating a Prefab" means is: You have a preconfigured object (with physics, 3D Model, attached scripts) and place it somewhere in the running game.

How you create your prefab is up to you. Easiest is probably in the editor with drag and drop, you could of course also do this in code.


Yeah I was basically asking can I code from scratch and was asking what language was more worthwhile to learn for it, of course there would be some things I'd have to google and use from others.

But yeah I basically wanted to learn a language and eventually code a project, nothing big or fancy

Put it this way, don't start with the question "What language is best", instead learn the programming fundamentals. Understand OOP, how objects interact, understand classes and structures and why they are used, understand arrays, lists and maps etc.

The language is the platform, its only the syntax that really changes smile.png you'll use the same technique in Java, C#, C++, JavaScript. The only differences between these languages is the way in which they are used, most suited to and basically what you can do with them.

Once you've understood programming concepts in general the sky is the limit.

In fact what I've picked up recently is that although I've gotten pretty used to C++ I am looking at learning Python for the simplicity of it, because I can use that in Blender. The engine will do the heavy lifting if you need it. During a project if you want to focus more on the design and visual aspects for the time being you can smile.png if you figure you'd like something to happen at a lower level (I don't know, AI logic) you can. Try that without an engine and it is a lot more difficult to switch between graphics and the underlying logic. So I believe Unity is a good place to start.

Like everything, you'll endlessly be learning syntax, as long as you understand the logic and workflow you'll be fine smile.png

Especially for indie developers, you've got the full power of OpenGL and DirectX, but unless you really need all those features, and optimisations it can offer you may as well stick to an engine that'll make your life easier.

One last note: The only thing I would not recommend is going into Unity without understanding programming concepts, because when something is implemented or you would like to implement something, things will get messy. Quickly. Understand the nitty gritty stuff and you'll happily use JavaScript, UnityScript, C# fine, because you'll know how things work under the hood.

Understanding languages will get you confused, understanding concepts and techniques will progress your knowledge further smile.png

One last note: The only thing I would not recommend is going into Unity without understanding programming concepts, because when something is implemented or you would like to implement something, things will get messy. Quickly. Understand the nitty gritty stuff and you'll happily use JavaScript, UnityScript, C# fine, because you'll know how things work under the hood.

Understanding languages will get you confused, understanding concepts and techniques will progress your knowledge further smile.png

+1

This is what a lot of programming newbies need to understand: the differences between most languages are smaller than you think.

Learning a new language is pretty easy when you know the core concepts of most programming languages. The hard part is then learning the new concepts unique to this new language.

A Java programmer will happily churn out C++ code after a short time of looking up the different syntax, as long as you hide the memory management and pointer topics from him.

I've used a C++ Engine that used Macros and stuff like that to basically hide away all the difficulties of C++. Besides using different syntax elements from time to time I was feeling right at home as a long time Java programmer (not saying here that this specific Engine/Framewrok design is inherently a good choice, just pointing out how similar Java and C++ Syntax is in their cores)

In the beginning it matters little what language you start with IMO.

This topic is closed to new replies.

Advertisement