How do I change the text of a MeshResource.generateText after I have created it and added it to an anchor?
Hello,
You will need to replace the MeshResource (which had the old text) of the ModelComponent of your entity with a MeshResource that has the new text.
For example:
You will need to replace the MeshResource (which had the old text) of the ModelComponent of your entity with a MeshResource that has the new text.
For example:
Code Block let originalTextMesh = MeshResource.generateText("Hello", extrusionDepth: 0.01, font: .systemFont(ofSize: 0.1)) let entity = ModelEntity(mesh: originalTextMesh) let newTextMesh = MeshResource.generateText("World", extrusionDepth: 0.01, font: .systemFont(ofSize: 0.1)) entity.model?.mesh = newTextMesh