GameMaker: Studio

GameMaker: Studio

View Stats:
gamer3192 Sep 20, 2016 @ 7:21am
How do I make enemies drop items?
I tried to make an enemy drop an item on death but I just did:
if (hp <=0)
instance create(x,y,obj_drop)

That did not work. So if anyone knows how to do this or knows a video on YouTube that explains this please let me know.
< >
Showing 1-3 of 3 comments
=/\= RVN =/\= Sep 20, 2016 @ 7:59am 
You might want to consider moving the code which creates the dropped item to the destroy event of the enemy.
Diveyoc Sep 20, 2016 @ 9:56am 
Not sure what the best way is, but I'll be looking into this soon myself.
I wonder if instance_change is a good option (in your step event for the enemy).

if (hp <=0)
{
instance_change(x,y,obj_drop)
}

You would need to code the end stop as well, but use another if statement.

if instance_exists(obj_drop)
{
type your end step code etc...
}
gamer3192 Sep 20, 2016 @ 4:37pm 
Originally posted by == RVN == gorronegro:
You might want to consider moving the code which creates the dropped item to the destroy event of the enemy.
I put it in the destroy event and it worked. Thanks
< >
Showing 1-3 of 3 comments
Per page: 1530 50

Date Posted: Sep 20, 2016 @ 7:21am
Posts: 3