• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Problem with instance_destroy

so I have an object, that has a radius around (I just went into variable definitions and put in 220 as a real value and then checked if my player was in it) and if so, play some text, the only thing is this is the step event, so obviously the text would repeat, so I made the instance destroy itself after the text, and yet the text keeps repeating itself, any ideas as to what my problem is? (I am very new to game maker by the way)
 
Hello,

you could simply put this in the draw event of the object to trigger the text.

if place_meeting(x,y,obj_player) ( this line will detect if the player is in contact with the trigger object.)
{
draw_text(x,y,"text here") (this line will draw whatever text you want at the x and y of the trigger object.
}

or

if distance_to_object(obj_player)<= 220 ( this line will detect if the player is within 220 pixels of the trigger object.)
{
draw_text(x,y,"text here") (this line will draw whatever text you want at the x and y of the trigger object.
}
 
Thank you for your response, but I cant just draw text that way, I have a script that I use to do that it draws the text for me and creates it with a typing effect etc, is there anything else I can do?
 
Hmm without seeing the script I can't give exact coding. I can give you an alternate idea to get that out of the step event. Is this something that could use a button command? Say if the player is within a range of trigger object and presses a button call a user event that runs your script. Which should only run the script once. If you can provide a video or code that would help us solve this issue.
 
Top