I'm trying to run an animation from a .dae file (3D model file) just once, this is my code:
SCNNode *object = (SCNNode*)[self getMyPlayerObject];
NSString *key = @"hit";
CAAnimation *animation = [_animations[key] copy];
[animation setSpeed:1];
[animation setTimeOffset:0];
[object addAnimation:animation forKey:key];
I've tried using animation.removedOnCompletion = YES;
but is not working, I've tried setting a delegate and tried to detect it with the animationDidStop:finished:
method, but it doesn't even get called, there's something weird when using CAAnimations
on SCNNodes
from DAE animations.
Is there any way of doing it?
Thanks in advance.