Hi,
I want to ask, how to implement mechanism that destroy object when leave my current sight (I’m don’t using views)
So, my current implementation (It’s a bullet object for clarification, if bullet leave player sight, I want to destroy it):
Step event of the bullet object:
The question is, when player plays the game a many bullet objects can be created in game, for example 200 objects at same time. Each of this objects must run the if condition in own step event, and i just think this can be a performance issue.
Currently work fine even for 200 bullets, but I don’t want to waste with resource, so question is, is there any better way of implementation? For example, in control object step event for all bullet instances with x < -100 and then destroy it all? Or something like this
Thanks for answers
I want to ask, how to implement mechanism that destroy object when leave my current sight (I’m don’t using views)
So, my current implementation (It’s a bullet object for clarification, if bullet leave player sight, I want to destroy it):
Step event of the bullet object:
Code:
if (x < - 100) {
instance_destroy();
}
The question is, when player plays the game a many bullet objects can be created in game, for example 200 objects at same time. Each of this objects must run the if condition in own step event, and i just think this can be a performance issue.
Currently work fine even for 200 bullets, but I don’t want to waste with resource, so question is, is there any better way of implementation? For example, in control object step event for all bullet instances with x < -100 and then destroy it all? Or something like this
Thanks for answers