Is it possible to animate the .backgroundColor
property of an SCNView
?
Please note, it is easy to animate the background of an actual scene (SCNScene
) and I know how to do that. It is also easy to animate the background of a conventional UIView
.
I’ve not been able to figure out how to animate the .backgroundColor
property of an SCNView
.
2
Answers
Just an addendum to the amazing & correct answer of @ZAY.
You have to do a frame-by-frame animation of the color and,
For some reason,
You do the action on the scene view
But. You run the action on the root node of the scene.
So, it's a miracle.
Works perfectly.
Assuming you take the default SceneKit Game Template (the one with the rotating Jet) I got it working by doing this:
Here is my
viewDidLoad
This might not be the best solution, but using a SCNTransaction I had no luck. Hope I could help in some way.