EllanJiang/GameFramework · error · GameFrameworkException
Entity group ' ' not exists specified entity '[ ] '.
Error message
Entity group '{0}' not exists specified entity '[{1}]{2}'. What it means
RemoveEntity removes an entity from the group's internal entity list and throws if the LinkedList<IEntity>.Remove call returns false, i.e. the entity was not present in this group. It is raised by InternalHideEntity when asked to hide an entity that the group does not actually own. This signals an internal bookkeeping inconsistency or a lookup targeting the wrong group.
Solutions
- Check that the entity id belongs to the given group before hiding (use EntityManager.HasEntity).
- Make hide/cleanup code idempotent: check entity exists before calling HideEntity.
- If this happens during shutdown, verify ShowEntity failure callbacks did not leave partial state; re-register or correct the entity-to-group mapping.
- Catch GameFrameworkException around HideEntity in defensive teardown code.
Example fix
// before
entityManager.HideEntity(entityId);
// after
if (entityManager.HasEntity(entityId))
{
entityManager.HideEntity(entityId);
} Defensive patterns
Strategy: validation
Validate before calling
if (!entityManager.HasEntity(entityId)) return; entityManager.HideEntity(entityId);
Try / catch
try { entityManager.HideEntity(entityId); }
catch (GameFrameworkException ex) { Log.Warning("Skip hide: {0}", ex.Message); } Prevention
- Check entity existence with HasEntity before hiding
- Make hide/teardown code idempotent
- Track which group an entity belongs to if you use group-level APIs
- Avoid double-hide from retry logic
When it happens
Trigger: Calling InternalHideEntity/EntityManager.HideEntity with an entity id that maps to a different group, hiding an entity twice, or entity tables out of sync after a failed show/show-null state.
Common situations: Hiding entities across scene reloads where the id lookup is stale; double-hide in cleanup code that assumes idempotency; custom entity helpers bypassing the standard Show/Hide flow.
Understand the failure class
Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.
Related errors
- Can not remove child entity which is not exist.
- Entity is invalid.
- Results is invalid.
- Can not add child entity which is already exist.
- Can not find entity ' '.
AI-assisted analysis of EllanJiang/GameFramework@d0c010b051 (2026-09-15).
Data as JSON: /api/errors/33dc1fee586b90e7.
Report an issue: GitHub.
Appendix: source
Thrown at GameFramework/Entity/EntityManager.EntityGroup.cs:354
public void AddEntity(IEntity entity)
{
m_Entities.AddLast(entity);
}
/// <summary>
/// 从实体组移除实体。
/// </summary>
/// <param name="entity">要移除的实体。</param>
public void RemoveEntity(IEntity entity)
{
if (m_CachedNode != null && m_CachedNode.Value == entity)
{
m_CachedNode = m_CachedNode.Next;
}
if (!m_Entities.Remove(entity))
{
throw new GameFrameworkException(Utility.Text.Format("Entity group '{0}' not exists specified entity '[{1}]{2}'.", m_Name, entity.Id, entity.EntityAssetName));
}
}
public void RegisterEntityInstanceObject(EntityInstanceObject obj, bool spawned)
{
m_InstancePool.Register(obj, spawned);
}
public EntityInstanceObject SpawnEntityInstanceObject(string name)
{
return m_InstancePool.Spawn(name);
}
public void UnspawnEntity(IEntity entity)
{
m_InstancePool.Unspawn(entity.Handle);
}
View on GitHub (pinned to d0c010b051)