instance destroy

  1. S

    Windows Collision Event Limitations

    Hi, can someone please explain to me what the collision event limitations are? Background information: I have a player object which has a collision event which checks against a bullet object. The player or enemy object is loosing actually health on collision, but I can't destroy the bullet...
  2. S

    i need help destroying other(without using event collision)

    if(place_meeting(x,y,obj_enemy1)){ instance_destroy(other) } The code above is the one that isn't working. I'm sure you have the idea of what I was trying to do. I'm guessing its because its giving true or false output, but I'm not sure how to make any alternatives without using event...
  3. Null-Z

    SOLVED The Curse of "Instance_destroy()"

    Moving this to a thread to bookmark after solving. context- " while creating the Galaga clone to break in GMS2 I run into the same problem with "instance_destroy()" where it destroys all instances in the room and I never remember how to remedy it." to put it another way, I want the bullet to...
  4. M

    instance_destroy() occuring too early

    I'm currently making a platform-esque game where 2 players are shot up into the room and have to bounce on cloud platforms to stay on-screen. I'm having issues with my instance_destroy() command, as it's preventing the clouds from spawning/destroying them too early. The code I'm using is...
  5. I

    multiple Item drops in position of enemy being destroyed (SOLVED)

    Hi, I'm still new to GML and I need help with multiple coin drops in position of where the enemy is destroyed. I have achieved this in some way, once I destroy multiple enemy in radius coins is dropped in its destroyed position however some times more coins is dropped in another position after...
  6. okasion

    GMS 2 Can't stop creating infinite instances help!

    I have this code on the obj_boss and obj_bossGhost: CREATE: //variables to move in loop coordx = room_width/2; coordy = room_height/2; r = 100; theta = 0; theta_speed = 2; boss_alpha = 1; yukari_instances = 1; STEP: //circle movement theta += theta_speed; if (theta >= 360) theta -= 360; x =...
  7. K

    id reference is invalid

    id_master is 100035. Why did this happened? id_master != noone is not good enough? if destroyed //boolean value { instance_destroy(); } else { if id_master != noone { x = id_master.x; //line 19 y = id_master.y; image_alpha = id_master.image_alpha...
  8. T

    GML Player Instance Destroyed When Switching States

    I've been handling my player's different attacks with a state machine, but I've encountered a recurring issue where if the player initiates an attack in midair at a certain close distance from the ground, the player object is destroyed and their hurtbox is left behind and it's occurring before a...
  9. J

    GMS 2 Find the Button then display text that door is now unlocked (GML)

    So I'm doing an assignment for Uni and we have been told to make a simple mechanic in GMS2. My mechanic idea is a simple stupid idea of find the button. I've made the map/background, the player, lighting and a button. I've also made a sprite with text in saying door is now unlocked. What I...
  10. A

    How to destroy a specific instance?

    Hello. I am making a game (mostly under the Shaun Spaulding tutorials) and I just want to make the bullet disappear when it hits the enemy. I'm not too sure how to go about this, most of the time it just destroys all of the bullets instead of just the one that touched the enemy. I am new at this...
  11. C

    GMS 2 How to make it so picking up one item does not destroy every instance of it.

    I currently have it set like this, but of course doing this destroys every instance of that object in the room. I was wondering if any one has any tips of how to do this. with(oPlayerPistol) { if(distance_to_object(oAmmoBox) < 10) and (key_interact) { ammo = ammo + 5...
  12. Krenzathal77

    Legacy GM "with" command destroying wrong object

    Bit of an odd problem here. I have it so that when my player land on top of an enemy the enemy gets destroyed - sort of similar to how the Mario games work. The issue is that the "with" command is completely destroying the wrong instances, in fact it's destroying every instance of a type of...
  13. A

    Legacy GM [SOLVED] Score only adds once

    HI there, Ok, in my prototype you use your cursor to move player and collect objects while avoiding others. Now each time I collect "obj_col_1" I want it to add +1 to my variable "Score" (not built-in "score"). But at the moment it only adds +1 after the first collection and then it stays at...
  14. O

    GML Destroying previous instance of object when new instance is created.

    Hello, I had recently asked for help on my game (topdown shooter) and I have a hopefully easily answered question. When my enemies die, they leave a bloodstain. I thought this would be cool to just have it stay there but when I'm fighting a crap ton it can be annoying. The bloodstain is an...
Top