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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Learn about unity commands?

Discussion in 'General Discussion' started by sumusiko, Sep 27, 2015.

  1. sumusiko

    sumusiko

    Joined:
    Feb 13, 2014
    Posts:
    37
    So I've been learning C# and it's pretty basic since I just need to learn the syntax and stuff, however I still got literally no idea how to do stuff on unity because unity has so many "unity unique" commands/functions that I just don't know they exist or which to use.

    What would be a good place to learn about all these unity commands? I can't even do something as simple as making a crosshair in the middle of the screen without googling. (And I don't want to be spoonfed, I must learn how to do it myself for a project)
     
  2. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
  3. sumusiko

    sumusiko

    Joined:
    Feb 13, 2014
    Posts:
    37
    Thing is I need to know all of them to fit what I need to do, if I need to do stuff with "OnGui" for example I wouldn't ever guess I would need OnGui since I don't even know it existed in the first place. That's my biggest problem
     
  4. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    You'll find your self using what BoredMormon said over and over and over again until you're tired of using the same thing over and over again lol.

    @sumusiko - You don't need OnGUI anymore unless you're doing editor scripts or want to do it the old fashioned way. Look into the new Unity UI.
     
  5. sumusiko

    sumusiko

    Joined:
    Feb 13, 2014
    Posts:
    37
    I needed to use OnGui apparently, to make a crosshair show up ingame, not sure about now, but I'll check it out and try to find a solution
     
  6. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    No you don't you can do it with regular UI. Without a line of code.
     
  7. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    There are several approaches to 'not knowing what you don't know' that I use with Unity.
    1. Browse the docs and the manual from time to time. Open up to a random page and start reading.
    2. Use google. Someone will have posted a similar problem and a solution. Use that as a spring board to find new sections of the docs or apply them in new ways
    3. Help out on answers. Every one struggles to set their own exam. Answering other peoples questions will force you to think about new problems
    4. Hang out in the scripting section. Its mostly just noobs wanting to know how to use GetComponent or track down a null reference error. But every few days a thread comes up where some of the more experienced coders share some of their techniques. These are great spring boards to start a google search into new ideas.
     
    MurDocINC likes this.
  8. sumusiko

    sumusiko

    Joined:
    Feb 13, 2014
    Posts:
    37
    All I can think of is making an image and resize it to the size I wish and make it a child of the main camera but if the game was online, wouldn't other players also be able to see the crosshair of each player this way?

    Either way, I'll look into it.
     
  9. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    As long as you make sure it's off for other players then no.

    That's how networking works. everything is on. But if the NetworkView or PhotonView(if using photon) is not yours, don't exist on the other clients.

    E.G. -

    if(photonView.isMine){
    enable stuff here.
    }
    else if(!photonView.isMine){
    disable everything here.
    }
     
  10. sumusiko

    sumusiko

    Joined:
    Feb 13, 2014
    Posts:
    37


    Oh thanks!

    One more thing:


    this is my current stuff, since i'm just trying some stuff still, however when I move the AK & CSS Arms into "FirstPersonCharacter" to make sure that the arms & weapon follow the camera/crosshair & not stay static, the AK & Arms just dissapear for some reason.

    Any idea what could possibly be causing this?
     
  11. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    You probably want to stop now.

    Multi player online games are typically not good ideas if you are struggling with figuring out a cross hair. Networking code is perhaps the most difficult type of programming to approach. Start smaller and work your way up to it.
     
  12. sumusiko

    sumusiko

    Joined:
    Feb 13, 2014
    Posts:
    37
    Yea I wasn't planning to do it, just wanted to make sure that other people wouldn't see it if I ever go for an onine project
     
  13. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    That's what Bored is trying to say. You either do it or you don't, otherwise you're gonna practically be creating everything you do create all over again.
    I'd recommend sticking to single player right now as well.

    Seriously we aren't trying to be mean. I admire the 'want' to want to build the game you want, but all good things come in time buddy. I'd try to learn all the basics and master them before moving on to harder things.
    Heck I sat in unity for a year just doing basic stuff. Then once I mastered that, I had a firm grip on how everything was done, well - to a point. But I was able to move on to harder and better things.
     
    Kiwasi likes this.
  14. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Its important, especially on your first few games, to clearly limit your scope. Define a bunch of things that your game will not do. And don't give in to the temptation to change the list, or your game will never be released. For a FPS type game this might include:
    • I will not include multiplayer
    • I will only launch on PC
    • I will not include a custom level editor
    • I will not include crafting
    • I will not include customisable anything
    • I will not do open world
    • I will only include x number of weapons
    • and so forth...
    And don't be afraid of Google. There are far too many techniques to learn all of them and hold them all inside your skull at once. Consider Google and the resources it allows you to access to be an extension of your memory.

    There is an anecdotal story that Einstein was once asked for his phone number by a reporter. He promptly opened the phone directory, looked up his number, wrote it down, and passed it to the reporter. The reporter was dumbfounded that the smartest man on the planet* could not remember his own phone number. Einstein responded saying "Why should I memorize something I can so easily get from a book?"

    I have no idea if the story is true or not. But it does illustrate an important point. Most intelligent people I work with these days are masters of how to find and use information. Not how to memorise it.

    *I was not yet born at the time of this story
     
    Rodolfo-Rubens likes this.
  15. sumusiko

    sumusiko

    Joined:
    Feb 13, 2014
    Posts:
    37
    The thing with googling is that I'll be using someone elses code and if I don't fully understanding, when presenting the project to judges if they ask me what does this particular piece of code does and I don't know I'm done. I wanted to be the one coding everything from scratch (All the assets that aren't included right away from unity)


    So far for this project I only have a few desires and I'll end it there.

    Make at least 7-8 different weapons. Make the shop, get the guns to shoot, make zombies walk / run towards player with decent AI, make a login screen, store a bunch of different stuff in a database for players to be able to start the game from any computer. (if it was online, I need databases in this project for the judges.)


    Also could you maybe take a look at what might be happening?




    this is my current stuff, since i'm just trying some stuff still, however when I move the AK & CSS Arms into "FirstPersonCharacter" to make sure that the arms & weapon follow the camera/crosshair & not stay static, the AK & Arms just dissapear for some reason.

    Any idea what could possibly be causing this?
     
    Last edited: Sep 28, 2015
  16. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,142
    Simple. You're trying to run before you've even learned how to crawl. If you cannot handle creating a crosshair then you don't have any chance of succeeding in making a complex game. You need to stop and learn the tools first. Best way to do that is to go through the Unity Learn section.

    http://unity3d.com/learn

    Once you've done that you start making simple games (one gameplay mechanic) until you have a good grasp of the tools.
     
    Last edited: Sep 28, 2015
    Ostwind and Kiwasi like this.
  17. sumusiko

    sumusiko

    Joined:
    Feb 13, 2014
    Posts:
    37
    Any specific tutorial you'd recommend as a must?
     
  18. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    This one.
     
  19. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,142
    They're all useful in some way.
     
  20. holliebuckets

    holliebuckets

    Moderator

    Joined:
    Oct 23, 2014
    Posts:
    496
    I see what you did there ;)

    Honestly, I always recommend the Roll-A-Ball tutorial as your very first intro to Unity. Its older now, but it gives you a very good overview of Unity's interface and really holds your hand through all of it. Its kinda boring if you know the code, but just kind of seeing where everything is in Unity will make you feel more comfortable with the software :D
     
    Kiwasi likes this.
  21. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Who me? I am totally innocent.

    Roll-A-Ball is probably the best place to start. Its actually been redone pretty recently for Unity 5, so everything is up to date.

    (It took the learn team a while to catch up. For a time I had my own version of the tutorial up on YouTube to catch the breaking changes from 4.6. But as far as I can tell there are currently no bugs in the tutorial.)
     
    holliebuckets likes this.