Unity Community


Page 1 of 3 123 LastLast
Results 1 to 20 of 42

Thread: c++? c#?


  1. Posts
    8

    c++? c#?

    Hello everybody,

    I am new to the Unity community and have a couple of questions. I have an Android phone that I would eventually like to upgrade Unity to, but for now I have to stick with Unity Free and do the web build.

    1. can you use c++ with Unity? I have virtually no programming skills but I have the option to take a c++ or c# college course. My college recommends I take c++ but I wanted to ask some real devs. which is better? why or why not? does c++ work for flash game development?

    2. I will be working alone with Unity, are there any pointers for a newbie, tutorials, hints tips etc for starting out?

    I really appreciate all the help. I have read some posts in this thread but not all of them. It looks like the community is doing some great things with Unity. Keep up the good work and Thank you all.


  2. Location
    Rapid City, SD, USA
    Posts
    1,569
    1) You sure can use c++ in unity, but that's only for native code plugins. If you have virtually no programming experience don't bother with C++. I had no programming experience when I tried learning it and I gave up. I found it a nightmare to use for a newbie. However, with C# I can at least remember some of what I program. Imo, use C++ if you understand basic programming concepts or if you know another language all together. As for if C++ works with with flash, I'm not sure I would assume so but I'll leave that to someone else.

    2) Check the various stickies out in the teaching section. Start as simple as you can and work your way up from there. Don't expect to be able to program an rpg or anything complicated for your first game.

    Edit: also, here is a link to the license comparison: http://unity3d.com/unity/licenses

  3. Volunteer Moderator
    Posts
    23,697
    You don't really use C++ in Unity. You can in certain specialized cases, such as plugins, but not for scripting. And definitely not for Flash.

    --Eric
    SpriteTile: new tile system that works seamlessly with Unity 4.3 sprites
    FlyingText3D: dynamic 3D text with TTF fonts | Vectrosity: fast & easy line drawing
    Nifty utilities! Stitch terrains together - runtime model importing - file browser - fractal landscapes


  4. Location
    Canada
    Posts
    147
    Short answer is no, you can't use C++ with Unity. In Unity, you can code in C#, UnityScript or Boo. You then deploy the same code to all the platforms supported by Unity. It does the conversion for you.

    Flash games are coded in AS3.


  5. Location
    NZ
    Posts
    2,933
    I would start with C# so you dont get scared off, especially while your just learning the basics of programming.

    C++ is a lot less mainstream than C# these days, therefore more programming jobs exist for it.

    If you want to end up being a game dev, you will need C++ unless youre using something like Unity.
    www.fingerbait.com :: Inferno - Multiplayer SciFi RTS :: Free Console

    Don't mind me, I'm just a Negative Nancy.


  6. Location
    san francisco, ca
    Posts
    466
    Learn both. C# and C++ are from the same C programming language roots, so they have some similarities. However, C++ will put hair on your chest...C# is kind and gentle with a lot of basic code done for you in the .NET libs. Learning C# can help you learn the big picture when it comes to programming and its concepts, while C++ its easier to get lost in the details as a beginner.

    But, in the end, if you want to be a game programmer for a game studio, you will need to learn C++. Its still the industry standard because of its speed, flexibility, and large legacy code base that most dev houses have. In reality, there is very little that C++ cant do (it may not be easy to do, but i doubt there's anything you cant accomplish in C++)

    last thing, as others already said, you can only script Unity in C#, but unity itself was written in C++. think about that.


  7. Posts
    8
    Thanks for the answers so far guys/gals.

    Basically what I am wanting to do is make my own game with a game engine. Indy games. I do not want to become strictly a "game programmer", I just want to know how to script my game with the prebuilt game engine when the time comes. I do not desire to build my own game engine.

    Does this mean go with c#? Also I just found out that I don't have the option to take a c# class because as of now it is not offered, (only intro to c++ and advanced c++) but maybe in the fall we will get a c# class... I am stressing a lot about this because I just want to be able to script a game that I build and don't want to build an engine.


  8. Location
    Canada
    Posts
    147
    I'm guessing you've never programmed before, because if you did, you would already know this. Programming knowledge is transferable in between languages. Yes there are some things that some languages do a little differently (and Assembly is something else entirely) but the general ideas are the same. So take the C++ class, since that's the only one available and most of the stuff you learn will transfer over quite easily.

    For example, this:

    Code:  
    1. int x = 5;
    2. int y = 10;
    3. if (x > y)
    4. {
    5.   //Do this
    6. }
    7. else
    8. {
    9.   //Do this
    10. }

    Is perfectly valid C++ and C# code.


  9. Posts
    122
    Quote Originally Posted by jman90 View Post
    Thanks for the answers so far guys/gals.

    Basically what I am wanting to do is make my own game with a game engine. Indy games. I do not want to become strictly a "game programmer", I just want to know how to script my game with the prebuilt game engine when the time comes. I do not desire to build my own game engine.

    Does this mean go with c#? Also I just found out that I don't have the option to take a c# class because as of now it is not offered, (only intro to c++ and advanced c++) but maybe in the fall we will get a c# class... I am stressing a lot about this because I just want to be able to script a game that I build and don't want to build an engine.
    if you're in the university, they usually teach C++ in the first year including simple graphicdraw mechanics, like drawing a cube and circles from code, and they teach C# in 2nd or 3rd year.


  10. Posts
    8
    So should I wait to use Unity until I have learned some programming?


  11. Posts
    428
    I would take the steps now to learn programming before your classes so that way you can go in with a basic understanding of what programming is and how to think when writing in it. There is a lot of tutorials for C# programming aimed at beginners, just Google it lol, and I would learn C# if you plan on using Unity
    Taptoon Games Facebook
    Auto-Magic Save System - the fastest way to save your games.


  12. Posts
    624
    Agreed, start learning the basics, do a few C# console applications and grasp the core concepts of programming. When you come to programming in Unity you'll then have a better understanding of how to design your code, and how to make things work the way you want.

    And I also agree on the point of learning C# over Unityscript and Boo, if you want to take your programming skills beyond Unity at any point, C# is the best way to go, much more support for it too.


  13. Posts
    736
    I agree, you need to learn programming first, and that the language of choice should be C#. I would also like to add that programming is a pre-requisite to using Unity, so unless you have at least the basics you won't be able to get anything done, at least not without posting "help!" on the forums every 5 minutes and try to con others to do your work for you.


  14. Posts
    173
    This is such a mixed thread Imo because although C# tries to handle A LOT of things for you, I frequently find it failing. Of course I'm coming from the experience of years with C++ before I ever looked into C# but when I'm just doing things for fun, I always use C#.
    I like to thing of this as a control scale for the languages. C# protects from your own mistakes quite often. C++ lets you make those mistakes and see the outcome. C is unforgiving and can wipe your hard disk on accident. Assembly is even worse than c but lets you have unmodified control o er memory.

    Evenrually you learn to make trade-offs of memory for speed. This is where I see most languages struggle because C# uses tons of memory for ease-of-use.

    Here's a quick note though. If you can master C++ pointers mixed with object-oriented and polymorphism, your pretty much invincible in C#. Oh and learn the STL like the back of your hand. In C# that's anything in System.Collection.

    That's probably far too much for a beginner. Just master object oriented. Its in almost every language.


  15. Location
    USA
    Posts
    2,535
    Quote Originally Posted by Znoey View Post
    I like to thing of this as a control scale for the languages. C# protects from your own mistakes quite often. C++ lets you make those mistakes and see the outcome. C is unforgiving and can wipe your hard disk on accident. Assembly is even worse than c but lets you have unmodified control o er memory.
    That's less a question of C++ versus C# and more a question of an un-managed language versus a managed one.
    Fractured State - A moddable RTS game: Dev Blog | Facebook | Twitter | Youtube | ModDB

    Personal Twitter


  16. Posts
    376
    If you know c++, you know c#. My first experience with c# was on the first day of my current job, where they said "Here, this isn't working, fix it." I had only really ever used C and C++ up to that point, C# was just a matter of picking up the syntax (and some of the quirks of managed code).

    That being said, I'm of the opinion that you should also learn at least one layer below your main area of work...so for programming that equals some basic assembly and the principles of how things are done in the hardware. Helps tremendously in the long run.
    The ramblings of my blog: Black Unicorn Games


  17. Posts
    8
    Thanks a lot guys. The Unity Community is a good one. It seems like c# and c++ have their ups and downs so it is hard for me to weigh them out. but what Im guna have to do is stick to the course and take c++ which kind of bothers me for the fact that you cant script in c++ correct?
    c++ = game engine builder
    c# = scripting language
    Right?


  18. Posts
    8
    If this is the case I want to tell my college advisor that I do not ever plan to become strictly a game programmer and want to learn how to script my game instead


  19. Posts
    173
    Quote Originally Posted by XGundam05 View Post
    C# was just a matter of picking up the syntax (and some of the quirks of managed code).

    That being said, I'm of the opinion that you should also learn at least one layer below your main area of work...so for programming that equals some basic assembly and the principles of how things are done in the hardware. Helps tremendously in the long run.
    I whole-heartedly agree with this! I've had to jump around to obj-c and even though i don't know much of anything about obj-c, i'm able to get by because mostly programming is just syntax.


  20. Posts
    78
    I believe that if you are choosing to take a programming class, you should take the one that will help you the most in the short term. Once you know one language, it is much easier to learn others, especially in the case of C++ vs. C#. But it sounds like it is a moot point anyway since they aren't offering the C# class. Take the C++ class anyway. The syntax is really similar. If you know one, learning the other should be pretty easy.

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •