How to move entities

please, someone can help me with a script : where i can move entities (could be a box) from left-right to right left. and all these entities keep moving (without stop).
i try with this : this.entity.setPosition(Math.sin(Date.now() / 700), 0.8, 0);

but only just one entity moves

hope someone help me.
thank u for your help .

Hi @judith_g and welcome. You need to attach the script with your code to every entity that you want to move.

1 Like

I did it but the entity disappears

https://playcanvas.com/editor/scene/1337235
i don´t know how to make the other entities move like the box with the script :frowning:

I looked at your project. The entities do not disappear but with your code you set all entities at the same position. Because of this you can’t see them all. Maybe you want to use translateLocal() instead of setPosition().

https://developer.playcanvas.com/en/tutorials/manipulating-entities/

1 Like

thank u 4 your replying