Home Technical Talk

Learning JavaScrpt for Unity, any book/resource recommendations?

Im currently messing with Unity with the intention of building a little game. Now thay may be a way off yet as im very much a beginner with programming. I learned the real basics of C but never anything game specific and nothing object oriented.

Ive picked up a couple of really great books on Unity, which, along with the project based tutorials on the Unity site are allowing me to get a good handle on working and creating with the engine.

However, id really like to get a good scripting knowledge as well and I think some sort of book may be the best option.

The JS ref guide on the Unity site is great for checking specific functions etc but I think a 'learn by example.' Book might be more beneficial.

The problem ive found is that all JS books ive looked at are aimed at web dev rathet than games. Is this an issue? I feel like learning to build forms and webpage interaction wont translate to anything game related. I may be wrong though.

I know theres C# but I hear JavaScript is a lot more beginner friendly and all the books/tuts I have focus on JS.

So does anyone have any book recommendations, or web resources you g
have used and been impressed with?

Thanks

Replies

  • Peris
    Options
    Offline / Send Message
    Peris polycounter lvl 17
    I didn't really knew any object oriented programming before I got into unity, and got along fine with it, just study a lot of the example projects and download other people's examples :). The cool thing with unity is that the object oriented part is very visual, you're usually working with actual objects in a scene each running their own code loop. If you know basic C you should be able to get the hang of it fast I think, just experiment a lot. I don't know about any good books though, the only programming book I ever picked up was c++ for dummies lol
  • Slum
    Options
    Offline / Send Message
    Slum polycounter lvl 18
    Unity's JS is more commonly called UnityScript, as it's actually a javascript syntax as opposed to full implementation of javascript. A lot javascript books of stuff beyond syntax is going to be pretty useless in the unity environment.

    Your best bet is to just dive in, read answers.unity3d.com, and smash your face into the keyboard until something intelligible comes out.
  • Tom Ellis
    Options
    Offline / Send Message
    Heh thanks guys for the replies, much appreciated.

    Ok sounds like the best thing to do is just get stuck in. I must admit even with the little C knowledge I've got, things are kinda familiar and the example code is making sense.

    I got stumped a bit earlier as it seems like they've made a lot of changes since 2.5, which the books I have were written for. For example, the FPSController object had a script in 2.5 called 'FPSWalker' which was pretty straightforward and had like 30 lines of code, whereas in 3.0 it's called 'CharacterMotor' which is a LOT more complex. I'm sure it is all done for good reason, but it was a bit of a stumbling block.

    Thanks again for the replies!
  • Ben Apuna
    Options
    Offline / Send Message
    Not books, but these tutorials might help you get started.

    You might also want to check out Unity Develop which is a Unity/Javascript IDE made by the awesome guys at Blurst (code completion ftw). Here's a thread about it if you have troubles... and the actual thread which may have more info.

    I'm planning to take the C# or Boo route myself. C# because it's plain old C# which is transferable to other apps and has many tutorials/books available for it.

    It's strange that no one uses Boo it's supposed to be a Python offshoot as I'm learning Python atm it seems to be the more logical choice...
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    Just go c# its what everyone recommends, I am working here at work as well in c# for unity, its the most feature rich and complete language in unity. So don't even start with the Javascript as there are not even enough resources at unity to cover enough for your early learning.
  • Farfarer
    Options
    Offline / Send Message
    I've done fine with JS in Unity. Just picked it up from the example scripts that come with the standard asset packages. Between that and the reference manual and the community forums, you can get along fine.
  • Tom Ellis
    Options
    Offline / Send Message
    Thanks for the further replies, very helpful.

    Having done a bit of research, it does indeed seem like C# would be the more sensible language to learn due to it's versatility in comparison to JS, with XNA being a possible route for exploration later on.

    However, all of the learning material I've got for Unity covers JavaScript so what I'll probably do is go through them, and maybe pick up a couple books on C# alongside it, hopefully being able to translate what I'm learning in C# over to what I'm doing in Unity with JavaScript.


    Thanks again guys, much appreciated.
Sign In or Register to comment.