How to change color and Rotate entity with triggerenter?

I am not an expert in the code. I am looking for a way to change color and rotate with constant speed an entity when triggerenter and automatically stop it with triggerexit … The color already works well … I can not write the rotation…
. I have another script that works well to rotate entities, it is very short but I do not know what lines I should use in the project to turn the entity … // var Rotate = pc.createScript(‘rotate’); Rotate.prototype.update = function(dt) { this.entity.rotate(18 * dt, 0 * dt, 0 * dt); }; this is the project. The small cube (rigid body) move with click. Big cube is triggered. …the link. https://playcanvas.com/project/545253/overview/triggered. Thanks