Touch.Alpha orientation

0 favourites
  • 6 posts
From the Asset Store
Is a system for building scorecards and achievements online for use in games Using this system, you can create a scorebo
  • Problem Description

    When using Touch.Alpha to rotate a sprite towards the ground in real life/ the center of the earth (img bellow to explain what I wanted to happen better), the outputed value from Touch.Alpha is not correct/ consistet.

    (Higher rezolution link: https://www.dropbox.com/s/237oi0dw8bp2g ... n.png?dl=0 )

    This has happened on 3 phones from different brands.

    Attach a Capx

    https://www.dropbox.com/s/geeytfhct5juj ... .capx?dl=0

    Apk files already packed: https://www.dropbox.com/s/h37dturxjtevi ... k.zip?dl=0

    Description of Capx

    Sets the angle of the sprite ("Circle") to the device's Touch.Alpha. The user can also add 0, 90, 180 or 270 extra degrees to the circle's angle by pressing the buttons at the bottom left of the view.

    Steps to Reproduce Bug

    • Instalation: Open and install the .apk file that works based on your device's processor. if the device is based on an Intel processor, run the file that has "x86" in the title; if it is arm-based, run the file with "arm" in it's title. This can be determined by serching for the device's specifications, or It can also be found trough trial and error, as the wrong .apk file will not install. The device may prompt you to turn on unknown sources. It can be done from settings - security - unknown sources and is required for any .apk file that does not come from a known source (ex. Google Play).
    • Usage: Once the app is installed and opened, rotating the phone on the Z axis should rotate the sprite. If the ball is not orientated correctly, you can add an offset to it by pressing the buttons in the lower left corner.

    Observed Result

    The sprite rotates when the phone is rotated and points towards the ground irl when held vertically, but if the phone is laying on it's side (horizontally), or in any other orientation, the sprite does not point correctly.

    Expected Result

    When the phone would be tilted, the sprite would point downwards relative to the ground in real life (like in the images from above)

    Affected Browsers

    Not applicable, as it is a standalone application.

    Operating System and Service Pack

    Windows 10, service pac 0, I belive (In pc - properties, under windows version it only said "Windows 10 Pro")

    Android V. 6 and 7 (Xperia z3 and Samsung S7)

    Construct 2 Version ID

    R244

  • Touch.Alpha gives the compass bearing, so you're using the wrong value here.

  • Touch.Alpha gives the compass bearing, so you're using the wrong value here.

    Oh, sorry... Thought that would be the right one to use...

    So, what expression would I need to use? I also tried Beta and Gama, but neither of them worked.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • > Touch.Alpha gives the compass bearing, so you're using the wrong value here.

    >

    Oh, sorry... Thought that would be the right one to use...

    So, what expression would I need to use? I also tried Beta and Gama, but neither of them worked.

    Well, do you want just gravity, or do you want all acceleration?

    With acceleration:

    X = -Touch.AccelerationXWithG

    Y = Touch.AccelerationYWithG

    Just gravity:

    X = -(Touch.AccelerationXWithG - Touch.AccelerationX)

    Y = Touch.AccelerationYWithG - Touch.AccelerationY

    Then:

    Angle = angle(0, 0, X, Y)

  • Well, do you want just gravity, or do you want all acceleration?

    With acceleration:

    X = -Touch.AccelerationXWithG

    Y = Touch.AccelerationYWithG

    Just gravity:

    X = -(Touch.AccelerationXWithG - Touch.AccelerationX)

    Y = Touch.AccelerationYWithG - Touch.AccelerationY

    Then:

    Angle = angle(0, 0, X, Y)

    Oh my god! Thank you so much!

    I've been trying to switch to Unity in order to get this to work, but you saved me a lot of hassle!

  • Closing as not a bug.

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