I have a .dae file which is in shape of a Medal. Now this .dae file has a label element. I want to load this .dae file and want to update text on that label at runtime so user name will come there.
let originalNode = scene?.rootNode.childNode(withName: "label", recursively: true)
if let _text = originalNode?.geometry as? SCNText {
_text.string = "Mohsin Khan"
}
// another way i tried
let originalNode = scene?.rootNode.childNode(withName: "label", recursively: true)
(originalNode?.geometry as! SCNText).string = "Mohsin Khan"
I have tried various ways but nothing is working. For
originalNode?.geometry as! SCNText // returning nil
Below if the structure of my model: