How do I use the "Compare Orientation" event to move player on phone?

0 favourites
  • 5 posts
From the Asset Store
Very simple code without excess options (15 events for server and 11 events for client)
  • Hello,

    I have the 8 Direction Behaviour set on my player and several "Touch Orientation" events to make use of a phone's gyroscope and move the player in any given direction (e.g. tilting the phone forward will make the player go up and back would make it go down). Does anyone know how to fix the screenshot below? Right now the the player goes all over the place at the slightest tilt. The game is set to be played in landscape mode.

    Thanks in advance,

    Himesh

  • Seems like you made a mistake with < > signs. Try changing the conditions like this:

    Beta <-1

    Beta >1

    Gamma >1

    Gamme <-1

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Seems like you made a mistake with < > signs. Try changing the conditions like this:

    Beta <-1

    Beta >1

    Gamma >1

    Gamme <-1

    Hi Dop,

    Thanks for the reply. I changed it to your condition variations, but now the player keeps bumping to the edges of the screen at my tilts. I tried switching the up and down directional events so Beta <-1 is up and >1 is down. This kind of worked for the forward and backwards tilt when the phone was in portrait mode, but my game is best suited for landscape play - I'm wondering if this is where the problem is. I've attached the screenshot with your conditions just in case I misunderstood. Otherwise, do you know the orientation event conditons for landscape view (please and thanks)?

    Himesh

  • I'm not sure, maybe you need to use Beta value to control Left/Right movement, and Gamma to control Up/Down?

  • I'm not sure, maybe you need to use Beta value to control Left/Right movement, and Gamma to control Up/Down?

    Thanks! I've managed to crack it with the correct combination. Added the screenshot below for anyone else needing help with this.

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