Rotating sky in latest version of A-Frame

Viewed 182

Can anybody help me convert code from 0.8.2 to what the latest version of A-Frame requires? The following code worked fine in 0.8.2 to rotate the sky, but I can't figure out how to get it to continue working with the latest A-Frame version. I need other features from the latest version that do not work in 0.8.2, thus the need to update.

My working code:

> <a-sky
> src="https://cdn.glitch.com/913639bf-0f9d-4623-94ee-35cb7bec54f5%2FHempsterFront.jpg?v=1616790774923">
> <a-animation attribute="rotation" fill="forwards" easing="linear"
> dur="18000" to="0 360 0" repeat="indefinite"></a-animation>   </a-sky>

Updated code?

Thanks!

2 Answers

You need to rewrite it as an entity attribute animation. Take a look at A-Frame Animation documentation

Working example

<!DOCTYPE html>

<head>
  <meta charset="UTF-8">
  <script src="https://aframe.io/releases/1.2.0/aframe.min.js"></script>
</head>

<body>
    <a-scene>
      <a-sky src="https://cdn.glitch.com/913639bf-0f9d-4623-94ee-35cb7bec54f5%2FHempsterFront.jpg?v=1616790774923"
             animation="property: rotation; to: 0 360 0; loop: true; dur: 18000; easing: linear">
      </a-sky>
    </a-scene>
</body>

Yes - thanks Piotr. I had kind of stumbled into that yesterday before I saw your answer today. Not much difference in it really, but doesn't take much for it to not work, ha. Thanks again.

Related