Version: Unity 7.0 Alpha (7000.0)
LanguageEnglish
  • C#

EntityManager.SetName

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public void SetName(Entity entity, FixedString64Bytes name);

Parameters

Parameter Description
entity The Entity object of the entity to name.
name The name to assign. See remarks for caveats.

Description

Sets the name of an entity.


Note that any System.String names will implicitly cast to FixedString64Bytes. This conversion will throw, rather than truncate, if over capacity (61 characters). Thus, ensure your names fit, or manually truncate them first (via FixedStringMethods.CopyFromTruncated).

However, GameObjects converted to entities (via Baking) will have long names silently truncated.

For performance, entity names only exist when running in the Unity Editor.