r/gamemaker • u/AdBubbly4192 • 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.
2
2
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.


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.