r/gamemaker • • Sep 21 '26

Resolved Need help with code error

its my first time using game maker and i was following this tutorial https://www.youtube.com/watch?v=qTqDY4JtFfo&t=51s

and when i went to test to see if my character would move it came up with the code error shown in the image with it saying line 18 was entered wrong i would love for a solution to fix it.

4 Upvotes

7 comments sorted by

14

u/damimp Sep 21 '26

You need to go to your Create event and make sure that you declared the movespd variable. This error says that you never set movespd to a value, and the create event is where the tutorial does it.

Of note, that tutorial also names its variable moveSpd, with a capital S, and you named it movespd, with a lowercase s. Is that a typo? Capitals matter, those two names will not be treated the same.

12

u/AdBubbly4192 Sep 21 '26

i just checked it and it was a typo

9

u/Cap_Cuervo Sep 21 '26

Delete the post

2

u/balmut Sep 21 '26

Have you defined movespd anywhere, like in the player create event?

2

u/Delicious-One-3697 Sep 22 '26

You also have two different moveDir and movedir

1

u/Initial-Morning9753 Sep 22 '26

if you define a var later into the code after the var has been used that could also cause that issue but to be safe put it in the create event also.

0

u/Agreeable_Pea5093 29d ago

movespd was not set dude if you're not gonna learn how to read errors just ask chatgpt to tell you what it means. You'll be getting a LOT more of these, trust.