Hi,
I have an object which can be rotated. I want to execute something every 15 degrees of rotation.
Right now I set it up like this:
void Update()
{
float currentAngle = this.transform.eulerAngles.z;
if (currentAngle > 14.5f && currentAngle < 15.5f)
{
"do something"
}
.
.
.
}
and I have repeated this for every 15 degrees which works pretty well but seems way too complicated and not efficient at all to me.
Is there a more efficient way to approach this and if so how would you execute that?
Thanks in advance