How to combine two models together? I want another model to appear when the treasure chest is opened

I want another model to appear when the treasure chest is opened
https://www.babylonjs-playground.com/#BCU1XR#3442
other model https://cms-oss-sh-dev.oss-cn-shanghai.aliyuncs.com/jpc/2021-03-10/untitled1212.gltf

mesh.setEnabled(boolean) 

will add or remove a mesh from the render list on true or false

1 Like

I used the method you said, but the second model did not come out :joy: Can you help me find out what went wrong. And I want to monitor the animation execution to a certain frame and do something, what should I do?

[image]

[image]

https://www.babylonjs-playground.com/#BCU1XR#3444

Hey several issues that I fixed:

  • it is setEnabled(true) and not setEnabled = true
  • you reused newMeshes1 (both in the callback and as a new entity)

Here is the fix: prova | Babylon.js Playground (babylonjs-playground.com)


This is a beautiful scene btw

3 Likes

I think the model inside is already inside when the box is about to be opened. How can I monitor the animation of the box to the frame when the box is opened?

For example, the animation is executed to the 50th frame,how to listen?

https://www.babylonjs-playground.com/#BCU1XR#3460

For example, when the animation of the first model is executed to 10 frames, the animation of another model will be executed.

1 Like

i thought one Solution then animation finish callback function (=onAnimationGroupEndObservable)
one animation(full 60 frame) split into 50 and 10 frames and
50 frame animation finish callback function and play next 10 frame animation and other function at the same time
i checked animationGroup but frame control not possible , just find " goToFrame(number)"
also find by set animation play value first and end therefore you want to tracking the frame is not the best way to find special cases

1 Like

OK,thank you , Let me think

:grinning: