What would be the best way/proper way od moving a sprite from A to B?

I have a game with runLoop on engine… And I was wondering how people here so the move animation usually.

In unity I usually did that in the update fps loop with usage of the delta time and stuff. How is it done here usually? I am interested with sprites moving from a to b.

Also can you attach sprite to the box? Or any other element?

You can use the scene.onBeforeRenderObservable observable to add a function that will be executed each frame:

scene.onBeforeRenderObservable.add(() => {
    your code
});

Sprites can’t be attached to 3D elements, you will have to simulate it by updating the sprite position according to the parent mesh.

1 Like