# Entity euler rotation

When i do this.entity.getEulerAngles().y , i get values from 0 to 180, and inverse with negative value
What I need is from 0 to 360, how can I get that data from the entity rotation?

See this post: How to properly use entity.setLocalEulerAngles?

TLDR, you can’t with getEulerAngles(). If you are working directly with euler angles, you have to keep track of the rotation values yourself.

If you need to calculate the value, you have to do that yourself via trigonometry and using the directional axis on the Entity.

As you may already know I am working on a roulette app.
I don’t need Euler angles specific, I need any value in order to determine every quarter of the wheel
So it can be from 0 to 1, or 0 to 360, it doesn’t matter as long the value itself doesn’t repeat
Is there any similar function avaliable?

Not out of the box, no.

How are you setting the rotation of the object in the first place?

What I would do instead is;

``````this.localYRotation += dt * this.curSpeed * this.inverse;
this.localYRotation = this.localYRotation % 360; // As long as it's being rotated in a positive direction
this.entity.setLocalRotation(0, this.localYRotation, 0);
``````

And that way you have the y angle to work with.

Try this, as well:

``````var RotateAlongAxis = pc.createScript('rotateAlongAxis');

type: 'number',
enum: [
{ 'x-axis': 1 },
{ 'y-axis': 2 },
{ 'z-axis': 3 }
]
});

type: "number",
});

// update code called every frame
RotateAlongAxis.prototype.update = function(dt) {
var x = 0;
var y = 0;
var z = 0;
if(this.axis === 1) {
x = this.speed * dt;
}
else if(this.axis === 2) {
y = this.speed * dt;
}
else if(this.axis === 3) {
z = this.speed * dt;
}

this.entity.rotateLocal(x,y,z);
};

``````

‘rotateLocal’ is probably the function you want to call.