Updating matrix position not working

I’m using Instanced mesh when sampling mesh. I am using updatematrix function to update instanced mesh position. but how can I make the each instance mesh position update smootly?

I made an example using gsap but I think gsap onUpdate function is not working properly because async works

link: https://codesandbox.io/s/problems-forked-frvhs?file=/src/App.js:5470-5486

good day everyone, thanks in advance

This is the best I could do, using gsap for instances (it’s just a concept, not the ultimate solution): Edit fiddle - JSFiddle - Code Playground

@prisoner849 first of all thank you for the answer,
but inside I need to using mesh surface sampling. Do you have any idea for this situation?

Thank you, best regards.

Use it the same way, as you do it in your codesandbox :thinking:

Use the sampler to get initial positions. This is the only difference. Edit fiddle - JSFiddle - Code Playground

изображение

изображение

1 Like

Thank you very much indeed!

You’re welcome :beers: