-3
\$\begingroup\$

I'm getting this error:

FATAL ERROR in
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.

\$\endgroup\$
  • \$\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
2
\$\begingroup\$

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

\$\endgroup\$

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.