Godot Version
v4.22
So I have my project set up to use input map in project settings.
It’s to use the space bar when I run the app on the computer.
But, now I want it to work on iOS…
I can run it on iOS…
But, I can’t figure out how to make it so the touch replaces the space bar.
–
Under physics process I use a fly() function
func fly():
if Input.is_action_just_pressed(“fly”) == true:
velocity.y = POWER
animation_player.play("power")
–
I tried
func fly():
if Input.is_action_just_pressed(“fly”) == true or InputEventScreenTouch.pressed == true:
velocity.y = POWER
animation_player.play("power")
–
But it causes a crash.
Anyone have any advice?
I’d rather just add touch to the project settings input map.
I know I can add a node to do this … and have like a connected button.
But, I’d rather just any touch on the phone replace what the space bar was doing.