SOLVED Problems with a code

ELUCIO

Member
Hello, i speak spanish so my english is very bad,i have a problem, i wanna make a shooter game and i cant. Because "instance_create" its variable and not a function.
i see tutorials and forums, and they have "instance_create" in orange.
Hola, hablo español así que mi ingles es bastante malo, tengo un proble y quierhacer que mi personaje dispare pero no puedo, porque el codigo "instance_create" es una variable y sale en azul y no sale como en los tutoriales que es una funcion y en naranja.
GML:
Tecla_Disparo = mouse_check_button_pressed(ord(mb_left));

if (Tecla_Disparo){
var insShoot = instance_create (x, y, object_bala)  
}
 

TsukaYuriko

☄️
Forum Staff
Moderator
The tutorial you are using is for an old version of GameMaker and not entirely applicable to your version. Pay close attention to which version your learning resource is for.

Use instance_create_depth or instance_create_layer, the successors of instance_create.
 

ELUCIO

Member
its the same line and just change "instance_create" for "instance_create_depth" or "instance_create_layer"? or i change all or add something more, im new in gamemaker studio.
 

Let's Clone

Member
its the same line and just change "instance_create" for "instance_create_depth" or "instance_create_layer"? or i change all or add something more, im new in gamemaker studio.
The same line. Just add "_depth" to the end of "instance_create_".

Instance_create_depth requires an additional parameter, but you can just pass "depth" and it will give the new instance the same depth as whatever you're creating it from.
 
Your mouse_check_button_pressed usage is incorrect. You should not be including ord() at all.
So, change this line:
GML:
Tecla_Disparo = mouse_check_button_pressed(ord(mb_left));
to be:
GML:
Tecla_Disparo = mouse_check_button_pressed(mb_left);
 
Top