GMS 2 [SOLVED] Sprite dissapearing after four seconds of input

So I'm fairly new to GMS2 programming. I have a strange bug. Here's the code:

Code:
Step event

if lockKeys = 0 {
//Do a million things based on player input
}

if key_up {
    sprite_index = sPlayerH;
    lockKeys = 1;
    firingdelay = 0;
}
else {
    lockKeys = 0;
}
I want the player input to be locked, when the arrowkey up is pushed. So I have a variable that controls whether or not input can be made, if the arrowkey up is pressed or not. It works perfectly fine, except it dosen't. If no other input is given, when the game starts, and the arrowkey up is held for more than 4 seconds, and then released, the player object dissapears. If other inputs are given before holding the up key, it takes roughly 8 seconds for the player object to dissapear.

This is fairly odd. I have different speeds on my sprites - could this be the cause of the problem, or does anyone have any other idea?
 
we would deffinitly need to see more of your code to help, to verify if the player object is actually being deleted, or is simply flying away from something unforeseeable I would suggest having a draw even to draw a circle at a set coordinate, if the player disappears, but the circle stays, it means the player is flying away and not being deleted, or having its alpha or visible tampered.
 
Thanks, the drawing/message tip is good for bug testing - it really helped me test things.

It wasn't a flying problem, nor an object being deleted. It seemed to be something being reactivated assynchonous when releasing the arrowkey up. It's solved now :)
 
Top