Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | CoryParsnipson |
Hi,
I’m exporting my first game demo (pong) and I can’t move one of my paddles. The left paddle, player 1, is controlled by pressing KEY_A to go up and KEY_Z to go down. This works perfectly in the Godot preview.
When I export it to HTML5, the Z key is “broken” and no longer responds. But if I hold down left shift and then press Z, it works normally.
Here’s the relevant code imo:
func _process(delta):
if disabled:
return
if Input.is_key_pressed(action_up) && !disable_control_up:
velocity.y = clamp(min(velocity.y, -0.4) * 13, -max_speed, 0)
elif Input.is_key_pressed(action_down) && !disable_control_down:
velocity.y = clamp(max(velocity.y, 0.4) * 13, 0, max_speed)
else:
velocity.y /= 1.1
if (position.y > lower_bound.y && position.y < upper_bound.y && !disable_control_up && !disable_control_down):
hitting_side = false
And in my Player1 instance, I overwrite exported “action_down” variable to 90 (KEY_Z) in the editor…
I don’t know what where to look…
Also, please let me know if I should post any more information. Thanks!