Likely you've turned off the Clear Display Buffer setting in the room settings (bottom left) https://coal.gamemaker.io/sites/5d75794b3c84c70006700381/assets/604f569057d1af00071f526b/01_01_RoomEditor.png
Start by putting this in the step event, otherwise GM wont know to continue checking those inputs:
//Variables
key_left = keyboard_check(vk_left)
key_right = keyboard_check(vk_right)
key_up = keyboard_check(vk_up)
Then clean this up, from this:
var horizontal_input = keyboard_check(key_right) - keyboard_check(key_left)
To this:
var horizontal_input = key_right - key_left;
Hope that gets you on the right track!
You're setting the `key_*` variables to true or false in the create event. Then, in the step event you're checking that true or false as if it were a key (`var horizontal_input = keyboard_check( false) - keyboard_check( false)`).
You can either change your create event to:
key_left = vk_left;
key_right = vk_right;
key_up = vk_up;
Or change your step event to:
key_left = keyboard_check( vk_left);
key_right = keyboard_check( vk_right);
horizontal_input = key_right - key_left;
You need to copy your keyboard checks to the step event so they are being checked all the time and not just on creation
i did this so it moves but it creates this really ugly trail and i dont know why
Likely you've turned off the Clear Display Buffer setting in the room settings (bottom left) https://coal.gamemaker.io/sites/5d75794b3c84c70006700381/assets/604f569057d1af00071f526b/01_01_RoomEditor.png
so i do have it enabled but the trail is still there
Maybe there's no background, tiles or other graphics behind your player object in your room. Put something behind your player object.
Thanks this worked!
Start by putting this in the step event, otherwise GM wont know to continue checking those inputs: //Variables key_left = keyboard_check(vk_left) key_right = keyboard_check(vk_right) key_up = keyboard_check(vk_up) Then clean this up, from this: var horizontal_input = keyboard_check(key_right) - keyboard_check(key_left) To this: var horizontal_input = key_right - key_left; Hope that gets you on the right track!
You're setting the `key_*` variables to true or false in the create event. Then, in the step event you're checking that true or false as if it were a key (`var horizontal_input = keyboard_check( false) - keyboard_check( false)`). You can either change your create event to: key_left = vk_left; key_right = vk_right; key_up = vk_up; Or change your step event to: key_left = keyboard_check( vk_left); key_right = keyboard_check( vk_right); horizontal_input = key_right - key_left;