[ad_1]
I’m attempting to pause and resume the animation of a 3D scene in SwiftUI, utilizing isPaused however unsure why it would not pause or resume the scene’s animation. Right here is the code:
var scene: SCNScene? {
let scene = SCNScene(named: "mannequin.dae")
scene?.rootNode.scale = SCNVector3(0.6, 0.6, 0.6)
return scene
}
var physique: some View {
VStack {
SceneView(
scene: scene,
pointOfView: cameraNode,
choices: [.allowsCameraControl, .autoenablesDefaultLighting]
)
Button("Pause") {
scene?.isPaused = false
}
}
}
I attempted scene?.rootNode.isPaused however nonetheless nothing occurred, any assist can be nice.
[ad_2]
