I have a problem. I rotate it but SCNNode returns to its starting position.
Look at the gif please: https://i.ibb.co/X2kz6fK/ezgif-5-d0417c4423.gif
My code:
Thanks everyone...
I have a problem. I rotate it but SCNNode returns to its starting position.
Look at the gif please: https://i.ibb.co/X2kz6fK/ezgif-5-d0417c4423.gif
My code:
Thanks everyone...
On
Here is an example code snippet how to work with a SCNTransaction. This example has a completion handler. If you don't need this, you can delete the section for the handler.
// Scene Transaction with completion handler example
SCNTransaction.begin()
SCNTransaction.animationDuration = 6.0
// The completion handling section
SCNTransaction.completionBlock = {
SCNTransaction.begin()
SCNTransaction.animationDuration = 1.0
explosion.particleColor = UIColor.blue
SCNTransaction.commit()
}
cameraNode.camera?.focalLength = 50
SCNTransaction.commit()
// Scene Transaction without completion handler
SCNTransaction.begin()
SCNTransaction.animationDuration = 6.0
cameraNode.camera?.focalLength = 50
SCNTransaction.commit()
As you can see here, we are modifying the focalLength of a SCNCamera. Try to make a similar adaption for your transform value.
The code blocks below solved my problem.
Thanks