BUT there is a problem I can’t understand again. When I tween the position it works fine but when I tween the rotation it rotates AND scales up. Very very strange
EventReceiver.prototype.onRotation = function (event) {
// Use the camera component’s screenToWorld function to convert the
// position of the mouse into a position in 3D space
var angle = 0;
{angle = -5;}
{angle = 5;}
/*
* Notice that pressing and holding the space bar makes the block
*/
// Update the spinning cube
this.entity.rotateLocal(0, angle, 0);
I tried to do something in augmented reality. the idea was that an entity receiving the event would turn every time a broadcasting entity (daughter of an augmented reality marker) appeared on the scene. That is, while arcamera approaches the marker, the issuing entity will appear and the receiving entity will begin to rotate. and it will stop if the marker stops being seen and the issuer disappears
In summary, perhaps, the events are not necessary. it only takes an entity to start spinning each time the daughter entity of the marker appears on the scene