C
Cmi
Guest
So this code worked for me but after an update it started messing up. I want to randomly spawn an object with in the room but it spawns in the same pattern every time. here is the code:
// Spawn pie (random(x),random(y),obj_enemy
instance_create(random(608),random(-32),obj_enemy)
that's my code it just spawns in the same pattern every time even when I restart the game. Can you guys help me fix the code or get a better to spawn them better and randomly?
SOLVED
Create:
// Wait 2 seconds and than trigger the alarm
alarm [1] = 60;
// Randomize the spawn
randomize();
Step:
// Spawns the object
instance_create(irandom_range(0,608),irandom_range(0,-32),obj_test)
// Repeat this code
alarm[1] = 60;
// Spawn pie (random(x),random(y),obj_enemy
instance_create(random(608),random(-32),obj_enemy)
that's my code it just spawns in the same pattern every time even when I restart the game. Can you guys help me fix the code or get a better to spawn them better and randomly?
SOLVED
Create:
// Wait 2 seconds and than trigger the alarm
alarm [1] = 60;
// Randomize the spawn
randomize();
Step:
// Spawns the object
instance_create(irandom_range(0,608),irandom_range(0,-32),obj_test)
// Repeat this code
alarm[1] = 60;
Last edited by a moderator: