It looks like when calling the following function:
renderer.render(atTime: time, viewport: viewport, commandBuffer: commandBuffer, passDescriptor: renderPassDescriptor)
the time parameter is really important. Before I left it with zero and there were no animations. If you set it using CFAbsoluteTimeGetCurrent (), it seems that you can only get one animation (I just tested it). My game hero has an action for shooting, as well as walking, and setting atTime with CFAbsoluteTimeGetCurrent () only appears walking.)
However, our situations are slightly different. In my case, I also have a SCNView that displays the perspectives of the hero. Therefore, to run all the animations, I created a globe variable:
var globeTime:TimeInterval = 0
And saved the current time in the SCNView rendering function:
func renderer(_ aRenderer: SCNSceneRenderer, updateAtTime time: TimeInterval) { globeTime = time
And finally passed it to my SCNRender.
This solved my problem perfectly.
source share