Hovering

0 favourites
  • 5 posts
From the Asset Store
**** Fairy cartoon game sprite character pack ****
  • I have a character that can fly (infinite double jumps), I want to be able to press space to hover in the character's current position (while in air) and press space again to stop.

    I would also like for the player to not be able to move while hovering.

    I've made a global variable for being on the floor that is set to zero and I have the variable set to 1 (for on the floor) when the character is on the floor.

    Thank you in advance for the help.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • And where is the problem ? You just told us what you have done :D

    But here: Instance Variable should be better than a global variable. Make it on the player.

  • No, I only made a variable that determines that the player is on the ground.

    I can't make the character hover when it's in the air.

    I want to stop all movement on the player so that it only floats in the position that the space key was pressed.

  • No, I only made a variable that determines that the player is on the ground.

    I can't make the character hover when it's in the air.

    I want to stop all movement on the player so that it only floats in the position that the space key was pressed.

    Lol I couldn't quote because of the link.

  • So you give the player a instance variable like Hover 0=1 not 1= yes

    And in your move events you aks if he hover.

    Example:

    On Key w

    And

    Sprite.Hover != 0

    ->do it.

    if you just added the movement behaivor you do:

    ->Every tick

    --> if hoover = 1

    ---> disable movement

    --> else

    ---> enable movement

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)