1. Hello Guest! It's with a heavy heart that we must announce the removal of the Legacy GMC Archive. If you wish to save anything from it, now's the time! Please see this topic for more information.
    Dismiss Notice

Need explanation on how drag and drop random works

Discussion in 'Programming' started by Ignas, Apr 4, 2019.

  1. Ignas

    Ignas Member

    Joined:
    Apr 4, 2019
    Posts:
    7
    Let me say clear what I try to create.

    On top of the screen there is 3 ball spawners.
    Below screen is line.


    On start of the game, 1 ball will be already in the middle of the screen.
    Ball will fall down and after ball touches the line, new ball will be randomly spawned in 1 of the spawners.


    So my question is, how to make it work with drag and drop?

    If you can make an example, THAT WOULD BE GREAT.

    THANKS :)
     
  2. Miradur

    Miradur Member

    Joined:
    Jan 16, 2018
    Posts:
    129
    Here is a tutorial from @GMWolf , not D&D but probably helpful:



    Miradur
     
  3. TsukaYuriko

    TsukaYuriko Q&A Spawn Camper Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    1,748
    You could use the Choose D&D for this. Provide it with the instance IDs of the spawners, then create an instance at the location of the spawner that was returned by Choose.

    Providing you with a working example would be detrimental to your learning experience, so I can't recommend that practice. If you get stuck along the way, report back with what you've tried and we can see where to go from there.
     
  4. Ignas

    Ignas Member

    Joined:
    Apr 4, 2019
    Posts:
    7
    Thanks :)
     
  5. Ignas

    Ignas Member

    Joined:
    Apr 4, 2019
    Posts:
    7
    The problem is, I don't understand how to combine all together
     
  6. TsukaYuriko

    TsukaYuriko Q&A Spawn Camper Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    1,748
    Store the result of the random selection in a variable. Then refer to the coordinates of the instance stored in said variable when creating the new ball.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice