[Android] Node “Gate” problem

Hi!

I made a simple game for Android (to test the capabilities of the engine), in which control is carried out by tapping on the screen:

  • click on the left half of the screen - the object moves to the left;
  • click on the right half of the screen - the object moves to the right.
    For such control:
  1. we get the coordinates from the Surface Coords node at the On Surface event, we take the X value from there (let’s call it TouchX);
  2. we get the width of the window from the Window Info node, divide by 2 - we get the center of the screen along the X axis (let’s call it CenterX);
  3. if TouchX> = CenterX, then move to the right, if not, then to the left.

When running Window (Krom) and HTML5 (JS) - it works:

When launched on a smartphone, the error is:

I have a suspicion that the comparison of different types (integer and float) is not correct (look at the value of Touch.Coord.X for windows and for android).

Any ideas how to fix this?
Or is it time to write an Issue on github?

I am attaching an example with an error: error_coord.zip
Build for Android (arm64-v8a, armeabi-v7a supported): APK

P.S. The choice of orientation for the screen does not work, always the value “sensor” is set in the manifest.

1 Like
  • Using the buttons (invisible) from the UI will not work, it uses the Send Event and it turns out: I pressed it - it worked once, but I need the “Down/Touched” event.

  • It remains only to create invisible objects from through RayCast to check the “Touched”, but this is a perversion :slight_smile:

Hi @E1e5en,

I would like to test this too. Could you please upload the UI.hx trait as well. It is not present in the blend file.

@QuantumCoderQC, I’m sorry. Forgot to post.
Here is everything in the archive: error_coord.zip

@E1e5en I can confirm this issue. The issue appears to be in all C/HL targets. Opening a github issue is better at this point.

I tested it on windows C(HL) target

1 Like

Done