[GM] How to destroy instance from another instance

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
1,400
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Mar 17, 2011

Learn how to destroy an instance of an object from another instance of an object with a With Statement! :D

Check out my website for more tutorials and examples on Game Maker!
www.wizirdi.com

  • likes, 0 dislikes

Link to this comment:

Share to:

Uploader Comments (Wizirdi)

  • Ok, I see you like a GM God of the sort, so I was just wondering... how do you make it so that if you left click on an object, I destroy THAT specific object. Or... this is what I'm doing in my game... I want to have a vspeed collision with grass so that it smushes, I coded everything but when I do it, ALL the grass goes smushed.

  • @HeteroProductions I'm very confused. To make an instance destroy when you click it, just make a left pressed event in the object you want to destroy then put in instance_destroy(); What do you mean by smushed?

see all

All Comments (11)

Sign In or Sign Up now to post a comment!
  • Hi i like your videos, this is very useful and i hope u will continue ;)

  • OK so I did this and now it actually destroys itself

  • @Ozarka741

    I actually learned how, 6 months ago :P

    Thanks anyways :)

  • @HeteroProductions

    By "set the object to other", I mean in the collision event for the object that is colliding with the grass, execute the event and set the part that says "self, other, object" to "other".

  • @HeteroProductions

    When using collisions, set the object to other. That will effect only the grass where the collision is occurring. As for destroying one instance, go to the left pressed event.

  • So pressing the spacebar in this is like the hat guy says "Move!B!tch!Get outta the way!Get outta the way!Get outta the way!" lol

  • I was wondering.. Do you know how to destroy only ONE instance when you click on it? For example: I have 3 enemies, all named enemy1. If I click on enemy1 he destroys himself. But the problem is I only want One of them to die, but the All die.

    Can you make a tutorial showing how to destroy One instance?

    Thanks!

  • @Wizirdi

    You know when step on grass, the grass get's "compressed". That's what I want but when I code everything, and jump on the grass, all the grass on the level get smushed, even though I only stepped on one grass object... If you want, I can make a video out of it.

  • @HeteroProductions I was just about to ask the same thing :P

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more