Comunidad Game Maker

Ayuda => Preguntas y respuestas => Mensaje iniciado por: ariel... en Diciembre 07, 2020, 11:22:01 PM

Título: Me pueden ayudar
Publicado por: ariel... en Diciembre 07, 2020, 11:22:01 PM
 ??? :-[
if instance_number (virus)==0{
instance_create(200,100, covicho )
}
Cree este codigo pero me genera demasiados objetos y quiero solo crear uno
Título: Re:Me pueden ayudar
Publicado por: getnoff en Diciembre 08, 2020, 12:16:56 AM
[gml]
if instance_number(virus)==0 and not instance_exists(covicho)
{
     instance_create(200,100,covicho);
}
[/gml]

Comprueba que no exista el nuevo objeto, una vez creado no volverá a ejecutarse.