Skip to content

Make it easy to insert a Name component on an entity #429

@mgi388

Description

@mgi388

I'd like to be able to do something like the following so I can add a Name component to my entity.

local entity = world.spawn()
world.add_default_component(entity, types.MyType)
world.insert_component(entity, types.Name, construct(types.Name, {
    name "My Entity"
}))
-- or
world.insert_name(entity, "My Entity")

I haven't been able to get anything to work using construct or Name::new("My Entity") so I'm not sure if it's currently possible to even do this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions