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

First Time Game Maker Issues

Discussion in 'Scripting' started by excellentsamuraid, Feb 10, 2015.

  1. excellentsamuraid

    excellentsamuraid

    Joined:
    Feb 10, 2015
    Posts:
    2
    I shall be the first to say that I'm fairly new to this whole game making schtick and I'm also not the best at coding. I am making my way though, which is a big step for me. Though as not being very good at making script I came here to ask of some helpful persons for script assistance.

    Firstly I'm having an issue in which I'm not sure how to make my level select script have levels locked until you unlock them.

    My second issue being that I'm having trouble with getting my ball to have a third person view and controls like any normal game with looking at the back of the head and what-not. I've tried using Unity's prefab third person, but it just glitches into a grey screen and sends up a bunch of errors, but I also tried the First Person Controller prefab and that sort of worked... in a sense that the camera was at the right angle, but it wouldn't progress along the axis with the ball and the camera would spin as the ball rolled along. Also the controls still stayed as the script that I have.

    Screens




    If anyone is willing to assist I will post the Javascripts upon request.
     
  2. elmar1028

    elmar1028

    Joined:
    Nov 21, 2013
    Posts:
    2,353
    Use this:
    Code (JavaScript):
    1. Application.loadLevel = 1;
    Scenes (Levels) are ordered by their unique ID. The first scene you have loaded has usually ID 0. Next scene would be ID 1 and so on.
    Also, you need to know how to use UI in Unity. Then combine these two and you get a nice level select.

    However, if it's your first time I would suggest you to STOP learning Javascript right now! All documentations, all third-party plugins you'll encounter will use C#. In collaboration forums, people seek for programmers with C# skills.
    I did this mistake and now I encounter lots of issues in my game.

    Finally, for beginners like you get started with Learn section.

    Best of luck :)
     
  3. ThermalFusion

    ThermalFusion

    Joined:
    May 1, 2011
    Posts:
    906
    There is a Roll-a-ball tutorial that should adress your camera issues in the learn section aswell. You cant parent a camera to a rotating physics ball unless you actually want it to tumble around like mad
     
  4. excellentsamuraid

    excellentsamuraid

    Joined:
    Feb 10, 2015
    Posts:
    2
    I have a decent enough level select screen using the UI and the glory of JavaScript already, but my problem with it being that all of the levels will be shown at once and I don't know how to make it so the stages are locked until the completion of the one prior.

    Also, no I'm not going to stop just because you suggest it. I am going to continue to make a game and learn. Bugs will be had until they're resolved and that's why questions are a thing to be asked of others. This is a learning experience of my own choice because it is something I want to do for myself. In a school setting you are encouraged to ask for assistance as in the rest of life. No one can do everything alone. That is why I am here asking for assistance. And I do thank you for the assistance you have provided.


    Thanks for the tip. I'll probably wind up youtubing it and what-not. Though a game with a tumbling camera would be quite the challenge.
     
  5. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    The suggestion was to stop JavaScript and switch to C#. Not stop Unity.

    What you want to do is create an array for your levels. For a simple setup you can create an array of bools. Each bool indicates if the level is unlocked. For a more complex structure define a class or struct to hold the level data, and store an array of that. You can iterate over arrays, and collections in general, with foreach.

    You should also abandon OnGUI and switch to the new UI tools. There are links in my signature to some tutorials.
     
    elmar1028 likes this.
  6. elmar1028

    elmar1028

    Joined:
    Nov 21, 2013
    Posts:
    2,353
    I am not discouraging people to stop learning. I never did. In fact, I do quite the opposite.
    You must have misinterpreted my sentence: I said to stop using JavaScript in your game development because its not as welcome as C# and less supported by third party plugins. Apart from that every change you make in your script will be checked by Unity faster than JavaScript.

    I chose JavaScript because I happened to know some of it. Now I am good at it, which is a blessing and a curse at the same time. Game I am making would be the last to be programmed in JavaScript by me.
     
  7. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,033