How to do an endless rotation on a single direction on one axis using tween library?

Hi, can anyone help me with this. I’m trying to rotate an object endlessly on a single direction on the y axis using the playcanvas tween library. please help me.

There should be a loop option in the tween.

That said, if you just want to do an endless rotation, it be easier to just write it yourself as it’s only a few lines of code.

Thanks for the quick response, I actually want to use the tween library for different types of tween effects. I know that the loop option is there but I’m unable to rotate the object a full 360 degree. Right now the object is only rotating from 0 to 180 degree. I’m using this line of code entity.tween(entity.getLocalEulerAngles()).rotate({x: -180, y: -1, z: -180}}, 1.0, pc.Linear);

The rotation tween will take the shortest route to the target rotation meaning at best, you can get a maximum of 180 degree rotation using the tween rotation function.

Either use the tween library to tween a single value from 0->360 (this would mean wrapping it in a Javascript object) and set the euler angle yourself from the tween value or just write the linear rotation loop code.

thanks for you help.