decentraland / sdk

PM repository for SDK
Apache License 2.0
4 stars 4 forks source link

[BUG] `shouldReset` doesn't work as it should #1086

Open leanmendoza opened 4 months ago

leanmendoza commented 4 months ago

When shouldReset=true the animation should be reset when it finishes (https://docs.decentraland.org/creator/development-guide/sdk7/3d-model-animations/) imagen

Video:

https://github.com/decentraland/sdk/assets/8042536/a27d6e37-8ab4-410e-b14b-b0ee2761b7e4

Code to repro

function main() {
  const newEntity = engine.addEntity()
  GltfContainer.create(newEntity, { src: 'assets/teleporter/teleporter.glb' })
  Transform.createOrReplace(newEntity, {
    position: Vector3.create(2, 0, 8)
  })

  Animator.create(newEntity, {
      states:[
      {
          clip: "teleportOpen",
          playing: true,
          loop: false,
          shouldReset: true,
      },
      {
          clip: "teleportClose",
          playing: false,
          loop: false
      }
      ]
  })
}

assets.zip

leanmendoza commented 4 months ago

One of the affected scenes

https://github.com/decentraland/sdk/assets/8042536/f5331d0e-dc0f-4788-b7ec-9dadc8b312a0

Affected in terms of when it works as it should, the scene will appear to be buggy