1. Hello Guest! It's with a heavy heart that we must announce the removal of the Legacy GMC Archive. If you wish to save anything from it, now's the time! Please see this topic for more information.
    Dismiss Notice

GMS 2 instance_create no longer a function?

Discussion in 'Programming' started by maddiemelon, Apr 16, 2017.

  1. maddiemelon

    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!!
     

    Attached Files:

  2. rIKmAN

    rIKmAN Member

    Joined:
    Sep 6, 2016
    Posts:
    4,736
    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
     
  3. maddiemelon

    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...
     
  4. maddiemelon

    maddiemelon Guest

    Oh alright, thank you!!
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice