Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Check if the user assigned an anchor entity through the Sumerian web editor. If not, use a self-reference to the entity that owns our script component.
// Check entity that will get the anchor component
// -------------------------------------------------------------------
// Allow providing a specific entity in Sumerian where
// the anchor should be located in the scene hierarchy.
if (!this.anchorEntity) {
// Fallback: if the developer didn't set an entity in the editor,
// use this object (self).
console.log("no anchor entity provided - use self");
this.anchorEntity = ctx.entity;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.