Entity id is jumping from 1-11 to 1048583 after deletions #1268
-
|
My question is are this is intended entity behavior, or my code is incorrect and cause this? this happened after I remove all entity components when switching level. There is no problem after level switching, and my gameplay is working normally. Just weird and trying to know why this happened. Every level switch, the value will increment 1048583, 2048583.... and so on |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
edit, I found out it is intended behavior and get correct index+versions result by printing use: |
Beta Was this translation helpful? Give feedback.
edit, I found out it is intended behavior and get correct index+versions result by printing use:
void DebugEntity(entt::entity e) { uint32_t raw = static_cast<uint32_t>(e); uint32_t index = raw & 0xFFFFF; uint32_t version = raw >> 20; ImGui::Text("Entity Index: %d | Version: %d | Raw: %d", index, version, raw); }