• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

SOLVED I got a Programm error in Gamemaker Drag n Drop

A

Aidan

Guest
___________________________________________
############################################################################################
ERROR in
action number 1
of Create Event
for object <undefined>:

Variable <unknown_object>.on_ground(100003, -2147483648) not set before reading it.
at gml_GlobalScript_check_state (line 6) - if(on_ground == true)
############################################################################################
gml_GlobalScript_check_state (line 6)

Do you know how to fix it? I really need help!
 
A

Aidan

Guest
Relevant:
Thanks but can somebody give me an Example How Enumerators work in version 2.3
 
A

Aidan

Guest
Although I'm not sure how this related to the original topic, the Constants page of the manual should be sufficient.
I didnt want to make a new thread (because my prblem stems from my only Code which is about Enums) also the Tutorial is sadly Outdated
 

chamaeleon

Member
I didnt want to make a new thread (because my prblem stems from my only Code which is about Enums) also the Tutorial is sadly Outdated
Your problem does not stem from using enums. Your problem stems from not having a function definition for your code in the script that contains the on_ground comparison.
 

Slyddar

Member
The code looks like it's from one of my tutorials. The pinned comment, and the description of each video, mention this, which if followed, corrects the error :
** NOTE : 2.3 changes in Gamemaker ** As of August 2020, Gamemaker 2.3 has been released, and has changed the way scripts work. They are now added as functions, and when you create a script you will see a "Define a New Function" codeblock. The tutorial still works fine, but ensure all code for scripts is added under it's Define a New Function codeblock, otherwise you will get an error. For more information see this thread - https://forum.yoyogames.com/index.php?threads/dnd-code-error.78336/post-465045
 

TailBit

Member
Set on_ground to a value in the create event

Oh wait, you are trying to use it in the create event, well you need to declare it first.
 

chamaeleon

Member
Set on_ground to a value in the create event

Oh wait, you are trying to use it in the create event, well you need to declare it first.
It doesn't matter if it's declared in the Create event if the code using it is not wrapped in a function. If the code isn't, the code will run at game start before the instances exist.
 
A

Aidan

Guest
Thanks a lot this problem is Solved Sorry for multiple threads
 
Top