Object Move When Button Is Clicked..

Discussion in 'How Can I...?' started by kodagames, Jan 14, 2017.

  1. kodagames

    kodagames Avid Boxer

    Joined:
    Oct 11, 2015
    Messages:
    294
    Likes Received:
    115
    How can I click a button and have an object behind that button pop out or rise up, then when the button is released have the object go back down and be hidden.

    I've attached an image to help explain what Im looking to achieve. I've been trying different approaches to make this happen but am coming up short and need some fresh perspectives (I'm stuck).
     

    Attached Files:

  2. playsgames6666

    playsgames6666 Miniboss Boxer

    Joined:
    Nov 13, 2015
    Messages:
    1,168
    Likes Received:
    745
    Add advanced component to the object. The object will need to be a physics object. You will need two components.
    the first will raise the object on click, the second will lower. On the second make sure you check the activate on release.
     
    kodagames likes this.
  3. kodagames

    kodagames Avid Boxer

    Joined:
    Oct 11, 2015
    Messages:
    294
    Likes Received:
    115
    Hmm... I'll have gravity in the game if it's a physics object would gravity affect it, if so any idea how I would get around gravity affecting it. (I'll be trying as soon as I get back home :))
     
    Haseeb likes this.
  4. playsgames6666

    playsgames6666 Miniboss Boxer

    Joined:
    Nov 13, 2015
    Messages:
    1,168
    Likes Received:
    745
    Yea the gravity would effect it. Might be an issue, depending on how much gravity.
    you could play around with it, you might have to have the advanced component for lower the object, set to a number low enough that it won't just drop as a physics object but not to high so that the gravity will push it down in a smooth motion.
    If that makes sense. So the first click might be 10, and then release might be 1, as i said depends on gravity.
     
    kodagames likes this.
  5. kodagames

    kodagames Avid Boxer

    Joined:
    Oct 11, 2015
    Messages:
    294
    Likes Received:
    115
    @playsgames6666
    Fantastic advice as usual, thank you!

    There are a few issues because I have high gravity and high bounce set but maybe it will make the game more fun lol and I really appreciate you taking the time to respond, thanks again (I can't wait to show this game off :))
     
    playsgames6666 likes this.
  6. kodagames

    kodagames Avid Boxer

    Joined:
    Oct 11, 2015
    Messages:
    294
    Likes Received:
    115
    You the man!
     
    playsgames6666 likes this.
  7. playsgames6666

    playsgames6666 Miniboss Boxer

    Joined:
    Nov 13, 2015
    Messages:
    1,168
    Likes Received:
    745
    No worries, can't wait to see it...
    Played around a few times with something like this, but has never resulted in anything yet.
    Hopefully you can.
     

Share This Page