RealityKit AnimationGroup does animation not additive

Hi guys,

i want to animate a box that moves 1 unit along the x-axis, after that -1 on the y-axis and lastly 2 on the x-axis. I try to do this with a animation group:

var anim1 = FromToByAnimation(by: Transform(translation: [1,0,0]), bindTarget: .transform,  duration: 3)

var anim2 = FromToByAnimation(by: Transform(translation: [0,-1,0]), bindTarget: .transform, duration: 3, delay: 3)

var anim3 = FromToByAnimation(by: Transform(translation: [2,0,0]), bindTarget: .transform, duration: 3, delay: 6)     

var animGroup = AnimationGroup(group: [anim1, anim2, anim3], name: "group")
animGroup.additive = true

let animationResource = try! AnimationResource.generate(with: animGroup)   

box.playAnimation(animationResource)

Instead of doing the animations on top of each other, each animation resets my box to its initial position. So it's like:

  1. Box moving 1 on x-axis
  2. Box goes back to initial position
  3. Box moving -1 on y-axis
  4. Box goes back to initial position
  5. Box moving 2 on x-axis

I thought that setting the additive property would change that for me by setting it to true. But it's not working that way I guess.

What do I have to get a animation group that's not resetting to initial position?

Greetings Gabe

RealityKit AnimationGroup does animation not additive
 
 
Q