How do I make it so that if you push a button, your character teleports to a position?

1 favourites
  • 4 posts
From the Asset Store
Push the Box Puzzle Game likes Sokoban made with Illustrator
  • Basically if you have ever played Undertale, then you would know that when you are fighting a monster and you go to the 4 button that allow you to interact with them, you would know that unlike when you are dodging attacks, you can only blink to the other said button.

    What I mean by this is say your soul is on the item button, how do I make it so that you can not just move around as you please, but make it so that if you use a and d, you can go to the other buttons, but you can not change elevation, just your x position and you can only go to those four points

  • You first need to use a variable to differentiate when it can freely move and not. Then when it's set to not freely moving, there are several ways to do it. My approach would be while in this state pressing A subtracts 1 from a variable and D adds 1 to a variable, that can be of possible values 0,1,2 or 3 and each number corresponds to an on screen button, when var=0 it is on the first button for example.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • can you show an example of the code?

  • never mind I figured it out

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