Beginner : Rotate 2d Object?
Hi All
I've only spent a day or so in Lens Studio so bear with me.
I need to rotate a 2d image, i found the following snippet:
var transform = script.getTransform();
var event = script.createEvent("UpdateEvent");
event.bind(function (eventData)
{
var rotation = transform.getLocalRotation();
var rotateBy = quat.angleAxis(Math.PI*getDeltaTime(), vec3.up());
rotation = rotation.multiply(rotateBy);
transform.setLocalRotation(rotation);
});
This rotates the object as a 3D plane and that's not what i want.. i just want the 2d asset to spin/rotate.. in 2d :)
Can anyone help me?
Ah, i found a solution using: vec3.forward() instead of vec3.up()
Problem solved!