There is no reason for those error messages to come up if your code is identical to the tutorial's instructions at
8:55.
Here are the lines that correspond to keyboard movement in
get_input:
Code:
rKey = max(keyboard_check(vk_right), keyboard_check(ord("D")), 0);
lKey = max(keyboard_check(vk_left), keyboard_check(ord("A")), 0);
dKey = max(keyboard_check(vk_down), keyboard_check(ord("S")), 0);
uKey = max(keyboard_check(vk_up), keyboard_check(ord("W")), 0);
xaxis = (rKey - lKey);
yaxis = (dKey - uKey);
Make sure that your code matches every non-space character above,
including the case. As I have already said before, GML is case-sensitive. In particular, if you mess up the casing of the variable names, you end up working with an entirely different variable. That is one of several common causes of errors in that "Variable not set before reading it" form.
In addition, you need to stop posting code in screenshot form, and to start using code boxes as per community convention. Read the section on "things to keep in mind when sharing information" in the
Programming Forum Guidelines. And as a side note, read the item that says "show some initiative". Thus far you haven't demonstrated much of that, and responders around here are picking on you because of that.
At this point, I don't want to hear a single more question from you that stems from careless typography. All forms of programming require attention to minute detail. If this is not a skill that you intend to refine, then I encourage you to uninstall GMS and get a new hobby that doesn't require it.