Animations are played instantly - basically teleport

While I can’t send the exact version to the playground - certain issues with JSON communication and my objects - this snippet should be enough to see what I’m doing. What is wrong with this approach?

I’ve skipped normalization but that’s because they all have the same number of keyframes.

And yes, meshes are also loaded properly but I didn’t want to bloat the snippet too badly

https://playground.babylonjs.com/#799FP0#6

1 Like

Once each frame is given a different position value, it seems to work fine. I think we’d have to see more of the actual values that you’re using to help trouble shoot the issue, since it’s not reproduced in the PG. :beers:
https://playground.babylonjs.com/#799FP0#7

3 Likes

Hi @Qreczek just checking in, do you still have this issue? :smiley:

Yes, but I was focusing on other parts of the project. I’ll work to reproduce the issue in the playground in the coming week; sorry for keeping a topic open for so long

2 Likes

Ok I figured it’s better to post the answer here than to leave someone else hanging.

The issue was that I sent frames over the internet. The sending app was pushing gamestates into an array. Objects such as gamestates are not pushed as a complete copy but a reference so I was effectivly sending over package full of last frames.

To do a hard copy in JS without external library you need to do this wonky sh*t:

JSON.parse(JSON.stringify(gamestate))