1

I'm developing an AR app for iOS with Reality Composer.

In my scene I have a simple sphere that i want it to rotate forever without restarting the animation every time.

Currently I set up a rotation behavior for the Sphere as soon as the scene appears. The rotation lasts 20 seconds and I clicked to the loop button in order to make it loop.

enter image description here

Unlucky this won't give me the expected behavior: The animation lasts for 20 second and then it restarts but with a very ugly "lag".

Is there a way to make the rotation forever? In SceneKit it was something like repeatForever.

Andy Jazz
  • 36,357
  • 13
  • 107
  • 175
Daniele Citi
  • 159
  • 12

1 Answers1

0

For perpetual rotation in Reality Composer app you need to implement a Spin behaviour to a model. At first apply Custom Behaviour, then apply a Scene Start Trigger and at last Action Sequence Spin with default properties.

The only drawback is a "twitching" animation.

enter image description here

P.S.

However, there's one interesting workaround.


Andy Jazz
  • 36,357
  • 13
  • 107
  • 175
  • So there is no way to reduce the twitching? By code? – Daniele Citi Jul 09 '20 at 12:07
  • I tried to use `Experience.rcproject` file that comes with AR templates in Xcode – in most cases it works fine, but sometimes animation is lagging (twitching). – Andy Jazz Jul 09 '20 at 12:08
  • Nope. It's definitely a bug. You can't fix it using a code in RealityKit. It seems there's no workaround at this time. Let's wait for major updates of Reality Composer and RealityKit. – Andy Jazz Jul 09 '20 at 12:11
  • Yeah the problem is that when the animation ends it suddenly restart with a ugly lag. Same for you? – Daniele Citi Jul 09 '20 at 12:28
  • In 1 sec loop in this case... Yep, but sometimes with lag and sometimes without. So, I think we need to use 20 sec loop to somehow hide that bug... – Andy Jazz Jul 09 '20 at 12:40
  • 1
    Actually I already used a 20 seconds loop. Need to wait to un update... – Daniele Citi Jul 09 '20 at 13:03