GMS 2 instance_create no longer a function?

M

maddiemelon

Guest
Hi!
I upgraded to gamemaker studio 2, and I encountered something weird when I try to write instance_create(); now. It shows up purple as some new variable, instead of yellow as a function. I tried to look online for this problem...did instance_create(); get scrapped in the new version of gamemaker or something? And if so what's the new one?

But anyways I also tried doing the new instance_create_depth(); one, which has an extra argument where you specify what depth you want the object, but this did not create anything. And when I wrote it before it also showed up purple, like a variable, until I just rewrote it a bunch of times and it eventually turned yellow like a function. Any ideas? I put an image here to show you what I mean.

Thank you!!
 

Attachments

rIKmAN

Member
Hi!
I upgraded to gamemaker studio 2, and I encountered something weird when I try to write instance_create(); now. It shows up purple as some new variable, instead of yellow as a function. I tried to look online for this problem...did instance_create(); get scrapped in the new version of gamemaker or something? And if so what's the new one?

But anyways I also tried doing the new instance_create_depth(); one, which has an extra argument where you specify what depth you want the object, but this did not create anything. And when I wrote it before it also showed up purple, like a variable, until I just rewrote it a bunch of times and it eventually turned yellow like a function. Any ideas? I put an image here to show you what I mean.

Thank you!!
You know GMS2 comes with a manual, right?
It's not just for show either, it actually has useful information in it to introduce all the new GMS2 stuff!

Go here https://docs2.yoyogames.com/, type "instance" into the search box and look at the "Instance Functions", or open the help in the IDE and take some time to read through the relevant manual sections.

You want to use either instance_create_layer() or instance_create_depth()
If either of those didn't tokenize in the editor then you typed them wrong, and "instance_create()" turned purple because it isn't a valid function anymore - it's been replaced by the two I just mentioned.

For some extra reading:
New Functions List
Obsolete Functions List
 
M

maddiemelon

Guest
oh actually well, I just got the depth one to work, turns out the comma thing just didn't work hehe. But regular instance create still doesn't work...
 
M

maddiemelon

Guest
You know GMS2 comes with a manual, right?
It's not just for show either, it actually has useful information in it to introduce all the new GMS2 stuff!

Go here https://docs2.yoyogames.com/, type "instance" into the search box and look at the "Instance Functions", or open the help in the IDE and take some time to read through the relevant manual sections.

You want to use either instance_create_layer() or instance_create_depth()
If either of those didn't tokenize in the editor then you typed them wrong, and "instance_create()" turned purple because it isn't a valid function anymore - it's been replaced by the two I just mentioned.

For some extra reading:
New Functions List
Obsolete Functions List
Oh alright, thank you!!
 
Top