Search Unity

Pop-up menu design

Discussion in 'Game Design' started by Hexynator, Jul 19, 2019.

  1. Hexynator

    Hexynator

    Joined:
    Mar 3, 2017
    Posts:
    4
    Good afternoon,
    I would like to ask how i can make my click on open menu to open with a slide from bottom to top?
    Currently it's just pop up without any visual effects.
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,067
    This is an implementation question, not a game design question.

    But, briefly, you would probably use a Coroutine to animate your menu opening. Or you could use a tweening library, like DOTween. Or you could do it in the Update event, if you have some script that compares the target position/size to the current position/size.
     
  3. Hexynator

    Hexynator

    Joined:
    Mar 3, 2017
    Posts:
    4
    Oh, thank you for information, hope it help me to create what's in my mind :)
     
  4. Volcanicus

    Volcanicus

    Joined:
    Jan 6, 2018
    Posts:
    110
    Or create an animation and set a trigger on it to turn on/off and then the script for the on button is just an animation trigger. :p
     
    Ryiah and JoeStrout like this.
  5. newjerseyrunner

    newjerseyrunner

    Joined:
    Jul 20, 2017
    Posts:
    628
    Whenever I have an object that moves from one location to another, I have a "on" position which is a Vector3, and an off position. During every Update() it checks if it's currently in the correct position for the current state, and if not, it'll move in the direction of the proper position. I use it for everything from doors, elevators, water levels, and of course: UI elements.
     
    Last edited: Jul 24, 2019
    JoeStrout likes this.