EllanJiang/GameFramework · error · GameFrameworkException

Entity group ' ' is not exist.

Error message

Entity group '{0}' is not exist.

What it means

ShowEntity requires the entityGroupName to reference an entity group previously registered with AddEntityGroup. When GetEntityGroup cannot find the group, this exception is thrown. Groups manage instance pools and priorities, so an unknown group name cannot host the entity.

Solutions

  1. Call AddEntityGroup(groupName, ...) in initialization before showing entities
  2. Fix the group name string to match the registered name exactly
  3. Check GetEntityGroup(groupName) != null before ShowEntity

Example fix

// before
m_EntityComponent.ShowEntity(id, "Player", "PlayerGrop", null); // typo
// after
if (m_EntityComponent.HasEntityGroup("PlayerGroup"))
{
    m_EntityComponent.ShowEntity(id, "Player", "PlayerGroup", null);
}
Defensive patterns

Strategy: validation

Validate before calling

if (entityManager.GetEntityGroup(entityGroupName) == null) throw new InvalidOperationException($"Group '{entityGroupName}' not registered");

Type guard

bool GroupExists(string name) => entityManager.GetEntityGroup(name) != null;

Try / catch

try { ShowEntity(id, asset, group, userData); } catch (GameFrameworkException ex) when (ex.Message.Contains("Entity group") && ex.Message.Contains("not exist")) { Debug.LogError($"Unregistered group: {group}"); }

Prevention

When it happens

Trigger: Calling ShowEntity with a group name never passed to AddEntityGroup, or after the group was removed (RemoveEntityGroup).

Common situations: Typo in group name string (case-sensitive mismatch); group registered in another scene's bootstrap only; group removed during cleanup but entities still shown into it; config table references a renamed group.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of EllanJiang/GameFramework@d0c010b051 (2026-09-15). Data as JSON: /api/errors/b3e27084cce83ab9. Report an issue: GitHub.

Appendix: source

Thrown at GameFramework/Entity/EntityManager.cs:643

            if (string.IsNullOrEmpty(entityGroupName))
            {
                throw new GameFrameworkException("Entity group name is invalid.");
            }

            if (HasEntity(entityId))
            {
                throw new GameFrameworkException(Utility.Text.Format("Entity id '{0}' is already exist.", entityId));
            }

            if (IsLoadingEntity(entityId))
            {
                throw new GameFrameworkException(Utility.Text.Format("Entity '{0}' is already being loaded.", entityId));
            }

            EntityGroup entityGroup = (EntityGroup)GetEntityGroup(entityGroupName);
            if (entityGroup == null)
            {
                throw new GameFrameworkException(Utility.Text.Format("Entity group '{0}' is not exist.", entityGroupName));
            }

            EntityInstanceObject entityInstanceObject = entityGroup.SpawnEntityInstanceObject(entityAssetName);
            if (entityInstanceObject == null)
            {
                int serialId = ++m_Serial;
                m_EntitiesBeingLoaded.Add(entityId, serialId);
                m_ResourceManager.LoadAsset(entityAssetName, priority, m_LoadAssetCallbacks, ShowEntityInfo.Create(serialId, entityId, entityGroup, userData));
                return;
            }

            InternalShowEntity(entityId, entityAssetName, entityGroup, entityInstanceObject.Target, false, 0f, userData);
        }

        /// <summary>
        /// 隐藏实体。
        /// </summary>
        /// <param name="entityId">实体编号。</param>

View on GitHub (pinned to d0c010b051)