Refresh/Remove node in scenekit

Hi all

Someone knows why is it impossible to hidden/remove node
In scene kit?

I have 2 buttons that show two nodes separately
When I tape on the first I display the first node and hide 2nd
My function:

func addflowers(disp :Bool)
{
let flScene = SCNScene(named: "flowers. scn")
guard let flNode = flScene?. rootNode. childNode(withName: "plan", recursively: true)
else
{
fatalError("not find")
}
scene.rootNode.addChildNode(flNode)
flNode.isHidden = disp
if disp
{
flNode. removeFromParentNode()

}

}

================

func addbee(disp :Bool)
{
let beScene = SCNScene(named: "bee. scn")
guard let beNode = beScene?. rootNode. childNode(withName: "be", recursively: true)
else
{
fatalError("not find")
}
scene.rootNode.addChildNode(beNode)
beNode.isHidden = disp
if disp
{
beNode. removeFromParentNode()

}

}

How can I update/remove/refresh scenekit view?

SceneKit is an Apple API and so somewhat off topic for Swift Forums. You might have more luck posting your question to Apple Developer Forums. Make sure to tag it with SceneKit so that interested folks see it.

Share and Enjoy

Quinn “The Eskimo!” @ DTS @ Apple

Terms of Service

Privacy Policy

Cookie Policy