bahh66
February 3, 2023, 6:43am
#1
Hi,
I’ve made a game with buttons that simulated the arrow keys (up, down, right, left).
I want to do a variable that change the arrow keys for the button (right become left and left become right)
I tried with this
but it doesn’t work and i don’t know why?
Thanks for helping
Lucky-j
February 3, 2023, 6:50am
#2
So you use the buttons for left and right and they work correctly? But when you want to do them opposite they do not work correctly?
bahh66
February 3, 2023, 6:52am
#3
Exactly, the character don’t move with the button but it works directly with the arrow keys.
It’s to play on a mobile, so i don’t have the keys.
Lucky-j
February 3, 2023, 6:53am
#4
Oooh none of the buttons work to move the player?
bahh66
February 3, 2023, 6:54am
#5
I change only left and right, os the left and right doesn’t work.
Jump, up and down still works
Lucky-j
February 3, 2023, 6:57am
#6
But you only want the left button to move Ln to the right and the right button to move to the left? You don’t have other events to move left if the cursor is on the left button or right when it is on the right button?
bahh66
February 3, 2023, 6:58am
#7
No it’s only Ln that have to move
Lucky-j
February 3, 2023, 6:59am
#8
To test it, does it work if you take out the scene variable = 10?
bahh66
February 3, 2023, 7:01am
#9
No
If i remove the variable, it doesn’t work from the beginning of the level
Lucky-j
February 3, 2023, 7:15am
#10
I don’t know what it could be, unless you disabled the cursor somewhere.
I tried it and the only annoying thing that happens is when I lift my finger the cursor stays on the button and keeps me moving or jumping.
bahh66
February 3, 2023, 7:47am
#11
I didn’t find why it doesn’ work but i can fix it with this
I delete buttons and create new one with the new keys.
1 Like
Lucky-j
February 3, 2023, 7:56am
#12
Good job I never would have thought of that!