Create entities - AWS SimSpace Weaver

Create entities

Use CreateEntity() to create an entity. You define the meaning of the Api::TypeId that you pass to this function.

Namespace { constexpr Api::TypeId k_entityTypeId { /* value */ 512 }; } Result<void> CreateEntity(Transaction& transaction) { WEAVERRUNTIME_TRY( Api::Entity entity, Api::CreateEntity( transaction, Api::BuiltinTypeIdToTypeId(k_entityTypeId ))); }

The values 0-511 for Api::BuiltinTypeId are reserved. Your entity TypeID (k_entityTypeId in this example) must have a value of 512 or higher.