Oh yeah, they removed instance_create in GMS:2. However I keep using it adding this script.
It's probably a good idea to use their new system but I like the last one better(or at least I am way too used to it).
Create an script and name it instance_create then copy this code:
/// @description Creates an instance of a given object at a given position.
/// @param x The x position the object will be created at.
/// @param y The y position the object will be created at.
/// @param obj The object to create an instance of.
var myDepth = object_get_depth( argument2 );
return instance_create_depth( argument0, argument1, myDepth, argument2 );
Careful - you're jumping from one obsolete function (
instance_create) to the other (
object_get_depth). There is no depth setting in the object editor anymore, and it's not recognized as a function in the current version (IDE 2.2.2.413, runtime 2.2.2.326).
i am trying to make a top down shooter in gml, i've made all the movement and rotation but i don't know how to make the player shoot, i saw tutorials online and all of them said to use the function "instance_create" but every time i use that it just says it is a variable and it says nowhere that it is an actual function. i am using GMS2 if you could help me out and tell me what function to use and how to use it that would be greatly appreciated.
This topic is a perfect example of why one must take great care to pay attention to the software version being used. I can only recommend to always ensure that the content you are following is suitable for what you're using - as you can see, not doing so has a tendency to result in additional issues on top of what you were originally trying to solve.
I suggest familiarizing yourself with the term "layers" at least on a fundamental level (manual:
The Room Editor, Layers section) - not because your issue requires using them, just so you won't be using a feature that you don't have basic understanding of - and using
instance_create_layer as
@FrostyCat mentioned before, as this is the current standard practice. Using an up-to-date learning resource will help greatly to reduce the likelihood of further unnecessary complications.