I am trying to make an entity go up and down continuously it’s this.entity.translateLocal() I want it to go up ten and town ten. Yes, I did put this code in update. Here is my code
This.entity.translateLocal(0,0,-10) // to go up
This.entity.translateLocal(0,0,10) // to go down
Hi @Codeknight999! I think line 2 is overwriting line 1 if you do it in the same update loop. Maybe you can use a boolean or something like that to keep track of the current position.
When I run the code it says entity is not defined, I am using this code:
entity.tween(entity.getLocalPosition()).to({x: 10, y: 0, z: 0}, 1, pc.SineOut);
I also tried
this this.entity.tween(entity.getLocalPosition()).to({x: 10, y: 0, z: 0}, 1, pc.SineOut);