I'm getting this error:

action number 1
of  Step Event0
for object obj_player2:

Variable obj_player2.D(100004, -2147483648) not set before reading it.
 at gml_Object_obj_player2_Step_0 (line 5) - var xadd = keyboard_check(ord(D))- keyboard_check(ord(A));

I followed a tutorial on youtube, I changed the vk_left etc. to ord(a) instead since I need 2 players at the same time.

  • \$\begingroup\$ Have you tried reading the error? Variable obj_player2.D not set before reading it \$\endgroup\$ – Bálint Apr 20 '17 at 7:53

You need to put "" around strings. So ord("A").

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.