[Solved] - Jump height seems to change between desktop and mobile

The total jump height of the character is less when playing from a mobile device using the mobile controls vs. the desktop and keyboard controls. The player hit box sprite has the standard platformer behaviour and I don’t dynamically change any of the jump related settings in the game.

I thought it could be a resolution difference between the devices. In the game properties the game resolution is set to 1272x700 and I’ve tried with and without the “Update game resolution during the game to fit the screen” option both on and off with no impact. I do use the "Set game resolution resize mode to “adaptWidth” in an event, but I don’t see how a width setting could cause a height related issue.

All of the mobile controls are done via icons with events that result in the “Simulate pressing Jump key” action, so in theory the end Jump event is the same between devices.

I’ve confirmed the starting jump speed is the same between devices and I display it above the character just for testing. I’ve tried it on an iPhone and a tablet, they both produce the lower jump height.

Here is a bit of code for the player jump function:

Any ideas on what to check next? Anything I can research in debug mode? Other bits of code I should share in this post?

Here is the test build you can play if you’d like

This is the part of the first level that you get stuck on due to the height problem

Hello, thoe!

The reason why the jump height is lower on mobile is because you are using the “trigger once” condition in your event. It makes your event true just only one time and then stops simulating that you are pressing the jump key.
The problem doesn’t happen on desktop because by default the “space” key already works as a jump button and doesn’t need this event to make your player jump.
Just remove the trigger once.

1 Like

Rasterisko, thanks for the suggestion, that was absolutely the problem, the jumping is now back to the same on mobile or desktop. Great advice!

1 Like