-
Notifications
You must be signed in to change notification settings - Fork 74
Calling destroy in Entity update function crash the game #409
Comments
One usual approach is to defer the destroy till the end of the frame (start of the next frame) by using |
Alright, I see. |
I think I get what you mean though, are you using the fixed tick rates from snow app level or are you doing it yourself? You can limit the rate of update() calls using snow (via luxe also iirc) to get update() called at a fixed rate btw. There are two calls actually - the You can tell it to give you a fixed How were you approaching it? |
I am using Luxe.fixed_timestep and Luxe.fixed_frame_time, 128 updates per second and no interpolation for rendering. For some reason, with the exact same code it is much smoother than per frame delta time and vsync. |
Destroying an entity in update function crash the application at Scene.hx:514
The "entity in entities" iterator is invalidated when the current entity is removed from the list, causing a null exception.
The text was updated successfully, but these errors were encountered: