captain caveman
3rd February 2009 - 02:24 PM
QUOTE (Mukor @ Feb 2 2009, 07:55 PM)
Did you enter...
...or...
CODE
instance_destroy()
The second code line is correct.
i meant to say instance_destroy() sry, yeh thats what i put in
captain caveman
7th February 2009 - 11:29 AM
bump
Psychopath
7th February 2009 - 12:27 PM
look at the code for the cannonballs or other projectiles...they are destroyed when out of view...try to duplicate it...
and I don't think that using outside view 0 is best...I don't think it really does anything extra or less...I put all of my code in the step event...so I put the code for "out of view" as well...do whatever you like... :V
nuser_uame
15th February 2009 - 09:13 AM
possible problems:
-You are not using view[0] at all. Check if you're using another view, or if you're even using one.
-You put the code in the wrong place (not very likely, if you know what you're doing) It has to be in the bullet object if you want to destroy the instance of the bullet
-if you're sure you are using view[0], try entering this code in the step event of the bullet object:
if x < view_xview[0] || x > view_xview[0] + view_wview[0]
instance_destroy()
I'd also like to question how you know it's not working. What specifically is happening when you run the game? If the bullet is off the screen, how do you know it's still there? Either it's doing something while it travels, telling you it's still alive, or you made one slow bullet.