{ let pot = try? Entity.load(named: "teapot") guard let potItem = pot else{ return } let anchor = AnchorEntity(.plane(.horizontal, classification: .table, minimumBounds: .zero)) anchor.addChild(potItem) let textAnchor = AnchorEntity(.plane(.horizontal, classification: .table, minimumBounds: .zero)) textAnchor.addChild(self!.textGen(textString: "500mL")) textAnchor.position.y = 0.4 self?.scene.addAnchor(anchor) self?.scene.addAnchor(textAnchor) } func textGen(textString: String) -> ModelEntity { let materialVar = SimpleMaterial(color: .black, roughness: 0, isMetallic: false) let depthVar: Float = 0.005 let fontVar = UIFont.systemFont(ofSize: 0.05) let containerFrameVar = CGRect(x: -0.1, y: -0.1, width: 0.2, height: 0.1) let alignmentVar: CTTextAlignment = .center let lineBreakModeVar : CTLineBreakMode = .byWordWrapping let textMeshResource : MeshResource = .generateText(textString, extrusionDepth: depthVar, font: fontVar, containerFrame: containerFrameVar, alignment: alignmentVar, lineBreakMode: lineBreakModeVar) let textEntity = ModelEntity(mesh: textMeshResource, materials: [materialVar]) return textEntity }