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. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

Could someone point me in the right direction?

Discussion in 'Scripting' started by ScottRamsay, Jun 18, 2018.

  1. ScottRamsay

    ScottRamsay

    Joined:
    Aug 13, 2017
    Posts:
    10
    I apologize if I've posted this in the wrong section.

    I am building a very simple, 2D semi-open world game for kids learning English where the character walks around collecting objects.
    For example, if the voice over says, 'Blue ball', the player finds the blue ball, and so forth...

    As far as coding for items to collect, I can only find tutorials on collecting coins(like in super mario), and searches for 'inventory' and 'sequence objects' havn't yielded me good results either.
    So I know how to collect and store, but where do I go and what do I search to find relevant coding for the rest of this game?

    THANKYOU IN ADVANCE!
     
  2. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,772
    "the rest of this game" is a large and undefined problem space. You'll likely only get useful help on forums when asking more specific questions...

    I'm also a bit confused about how far along you are to give you any meaningful advice about what to do next.
     
  3. sadsack

    sadsack

    Joined:
    May 27, 2015
    Posts:
    156
    Read everything you can and watch every video you find. My problem seen to be where do I start.
    For me anyway I just start doing things I know how to do, then when I get to the point I don't know I read and watch.
    It works for me.
     
  4. ScottRamsay

    ScottRamsay

    Joined:
    Aug 13, 2017
    Posts:
    10
    ""the rest of this game" is a large and undefined problem space. You'll likely only get useful help on forums when asking more specific questions"

    Fortunately the game is made for 5 year old, so its very easy for me to explain.

    It's a 2D platformer and a bunch of colored balls are scattered around the platforms.
    Right now, the player can collect all the balls and finish the game.

    I am currently stuck on the implementation of instructions. I don't want player to collect all the balls, I want player to collect a specific ball. Once the specific balls(example, red) is collected, player needs to collect another specific ball(example, blue).
     
  5. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,712
    One thing that comes to mind is:
    Use the voice / text "order" with a target game object (ball) or at least its colour, if you can have more than 1 ball with a certain colour.

    Say you had voice clips : "Find the { "yellow", "green", "red" } ball".
    Store what should be found, and when 'collecting' (however that is implemented), simply check that what should be found is what was collected. Maybe "Ooops! That wasn't the { coloured } ball. Try again". for wrong.. who knows. :)
     
  6. ScottRamsay

    ScottRamsay

    Joined:
    Aug 13, 2017
    Posts:
    10

    Thanks you for input Methos. But what is that implementation i can use?
    I know i'll need if statements for 'if' the item is 'destroyed'(collected), so I guess what I need to know is the c# equivalent of 'then'.

    ---------------------------------------------------------------
    if (trig.gameObject.name == "Colourballs_red")
    {
    Destroy(trig.gameObject);

    ... 'then enable' "colourballs_blue?
     
  7. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,712
    I chatted with someone about another game that had a similar idea for ordered collection.

    One script tracks whichever is current and then when you collect an item, just check that it matches (by name, tag or something else). In your game, after that point, you would probably want to remove the found one from the list and choose a new one as 'current'.

    Does that make sense?