timestamp for reference 8:36
As it is seen when it stops, if the user attempts to spin over and over; wouldn’t the starting eulerAngle y value get larger and larger instead of resetting to (0, 0, 0) due to it not stopping at the same spinAmount each time? This is the issue I had, and I reset the eulerAngle to (0, 0, 0) every time isActive is set to false after a full rotation to correct any imprecision.
Sorry if I worded this strangely, I can reword if better.
private void Update() => RotatePlayer();
private void RotatePlayer()
{
if (!isActive) return;
float spinAddAmount = 360f * Time.deltaTime;
transform.eulerAngles += new Vector3(0, spinAddAmount, 0);
totalSpinAmount += spinAddAmount;
if (totalSpinAmount > 360f)
{
transform.eulerAngles = new Vector3(0, 0, 0);
isActive = false;
totalSpinAmount = 0;
}
}