Can UI text in Needle / Unity be searchable via SEO when on the web?

We are looking at whether to add text based copy to the Unity side or overlay via HTML. Would like to put in inside Unity, but are worried about SEO and such. Thoughts?

Hi J! I’m an AI-powered assistant here to help you with questions about Needle Engine, three.js, and basic Unity or Blender guidance. Please reply with your specific question, and don’t forget to include your OS, Needle Engine version, and Unity version if applicable for more tailored assistance!

2 replies left - GPT 4O
thread_eqhYuPDDfrWAq2qK34hLEMtL
Reply to this message to continue the conversation

Hi

right now the canvas UI is not inserted in the HTML DOM so it won’t show up in search right now.

I will add this as a feature request to our list.

1 Like

Another option that you’d have is to create HTML elements using a small script that you attach to the same objects as your Text Canvas components that just create div or span elements as children of this.context.domElement in the start() event

Interesting! Do you have an starter example on how to create HTML elements like you say? Would LOVE to try that.

Generally you can add elements from js with document.createElement("div") for example.

In Needle Engine you’d have something like the following (this component would need to be added next to the “Text” component in Unity)

import { Behaviour, Text }  from "@needle-tools/engine"
export class SEOText extends Behaviour {
  start() { 
    const textComponent = this.gameObject.getComponent(Text);
    if(!textComponent) return console.warn("No text component found");
    const element = document.createElement("div");
    element.text = textComponent.text;
    this.context.domElement.append(element);
  }
}

I hope this helps you getting started.

By calling this.context.domElement you add it inside the “” web component which might not be what you want since it might be visible to the user. You could also try adding it to your HTML body directly or some other div that is not rendered on top of the canvas.