You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an entity is destroyed, it is not removed from the spatial map, causing the destroyed entity to still be retrievable from its previous location and consuming memory.
Version
kaplay: 3001.0.0-beta.1
To Reproduce
Create a level.
Spawn a game object at location (0,0).
Destroy this game object.
Attempt to retrieve the object at location (0,0).
The destroyed object is still returned.
kaplay();loadSprite("grass","/sprites/grass.png");constlevel=addLevel([" =",],{tileWidth: 64,tileHeight: 64,tiles: {"=": ()=>[sprite("grass"),],},});constpos=vec2(0,0)level.spawn("=",pos)wait(1,()=>{constobj=level.getAt(pos)console.log(obj)destroy(obj[0])})wait(2,()=>{// shouldn't print the objectconstobj=level.getAt(pos)console.log(obj)})
Expected behavior
When an entity is destroyed, it should be removed from the spatial map and should not be retrievable in step 5.
The text was updated successfully, but these errors were encountered:
Describe the bug
When an entity is destroyed, it is not removed from the spatial map, causing the destroyed entity to still be retrievable from its previous location and consuming memory.
Version
kaplay: 3001.0.0-beta.1
To Reproduce
Expected behavior
When an entity is destroyed, it should be removed from the spatial map and should not be retrievable in step 5.
The text was updated successfully, but these errors were encountered: