Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Best way to learn scripting in unity with programming background

Discussion in 'Scripting' started by hosfordryan, Jun 23, 2014.

  1. hosfordryan

    hosfordryan

    Joined:
    May 4, 2014
    Posts:
    6
    Hi, I am just getting into Unity by watching tutorials on youtube. The problem that i am facing is that i have no idea how to learn what to do on my own. I have just over a year's worth of java programming experience, so i understand basic programming concepts. The thing i don't know is using programming to interact with unity. For example this if statement that i copied down from a tutorial:

    if(attacking.rigidbody2D.transform.position.y>rigidbody2D.transform.position.y - distance)
    {
    rigidbody2D.transform.position += Vector3.up * speed * Time.deltaTime;
    }

    What is a Vector3? What does rigidbody2D.transform.position mean? I am having problems like this.
    How do i learn what to use to make something move across the screen for example. I guess i am just having trouble learning what unity has and how to use those things.
    Sorry if this is a hard to understand question, it's a hard to explain problem. Any help or a link to how i can learn how to interact with unity would be greatly appreciated and wish me luck on my adventure into learning unity!
     
  2. Sharp-Development

    Sharp-Development

    Joined:
    Nov 14, 2013
    Posts:
    353
    1. GameObjects and Transforms -
    Transforms or in common terms "transformations" are "components" of unity which are basically assigned to any game object and component. Such a Transform is used to position, rotate and scale every single object either by world or by the local transformation matrix. Transforms are quiet common, you'll aswell find lots of topics on this on google since its nothing special to unity.

    http://docs.unity3d.com/Manual/Transforms.html


    2. As of Vectors... Basic math objects. A Vector3 is basically a vector with 3 components, meaning x, y, z which describes the current position in our cartesian coordinate system.

    http://docs.unity3d.com/Manual/VectorCookbook.html

    With a bit of googling you will aswell find more resources on the web since those two things are quiet common.


    Tho, you should definitly read some more guides / watch some more tutorials and especially read the unity manuals right att he pages I posted.
     
  3. hosfordryan

    hosfordryan

    Joined:
    May 4, 2014
    Posts:
    6
    Ok, thank you. I will definitely do that.
     
  4. Sharp-Development

    Sharp-Development

    Joined:
    Nov 14, 2013
    Posts:
    353
    But as a little bit of hope, we all started like this. ;) I remember when I started using unity, I felt totaly lost and couldnt do a single step without a guide. Nowadays, unity is my playground and I somehow feel all fluffy inside when booting it up. (Tho its constantly running) ;o
     
    smitchell likes this.
  5. smitchell

    smitchell

    Joined:
    Mar 12, 2012
    Posts:
    702
    I was thinking about it last night, the times when I just started and relied on google for everything and how beautiful it is now to just be able to write lots of awesome code without even having to look at the documentation very often. It's beautiful :)

    The best thing is not being intimidated by errors, as a beginner you'll probably fear errors; you'll have no idea what they mean and sometimes unity throws errors which aren't actually to do with the actual error and you'll just be able to figure it all out one day :)
     
    NomadKing and Sharp-Development like this.
  6. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    4,044
    Everyone learns differently. So some approaches work better for certain people.

    For me personally, the way I learn best is just to jump in. Figure out some -very- simple games you might want to try making then, make them. Try something like a Pong or maybe a little proof of concept where you can run around. Then try to add a few things, maybe add lasers to pong or coins you can collect or whatever strikes you as "it'd be cool if..." or "I wonder how I would add ...".

    One nice trick is to pick something that you can find a reference for or a tutorial that'll walk you through it. Then don't watch it. First take a pass at trying to figure it out yourself, take a stab at just writing it. Then if you really hit a wall, watch the tutorial. The process of trying to push yourself to figure it out first is the really important part. After that when they show you Vector3.MoveTowards or whatever, you'll really get it and see the value.
     
  7. JamesLeeNZ

    JamesLeeNZ

    Joined:
    Nov 15, 2011
    Posts:
    5,616
    How did you feel about java when you first started?

    Think of it the same way... Unity has functions/variable types that you use. Same as java does...

    Doing a handful of tutorials should help you get the picture, and as you progress you'll start learning whats available in the API.
     
  8. Iron-Warrior

    Iron-Warrior

    Joined:
    Nov 3, 2009
    Posts:
    836
    In addition to what everyone else has said, I'd recommend going through the Unity video tutorials on scripting. They give you a good basis of some of the functions/libraries in Unity.