Itween roatation is not working properly on low configuration pc with 2gb ram
Hi everyone I was working on a fortune wheel It is working fine on almost every device, However when it comes to low-end pc I mean really low-end pc with 2 GB ram and dual-core processors, the wheel is not working as expected. Please watch this video it only 18 sec -https://drive.google.com/file/d/1f3weiCBKCrGTwpOKLCfBRgxb7M4i9_aT/view?usp=sharing you will get a clear idea of it
If you watch the video closely the wheel rotation starts from left to right and suddenly change the direction at the end
we would need to see the code to know what is happening
public IEnumerator Spin(int wheelNo, string imageXfactor)
{
_nextWheelNo = wheelNo;
if (_currentWheelNo == _nextWheelNo)
{
_customAngle = 0;
}
else if (_currentWheelNo > _nextWheelNo)
{
_customAngle = Mathf.Abs(_currentWheelNo - _nextWheelNo) / 10f;
}
else
{
_customAngle = Mathf.Abs(10 - (_nextWheelNo - _currentWheelNo)) / 10f;
}
if (!_isStarted)
{
RearangeAwardImages(imageXfactor);
_isStarted = true;
_customAngle = noOfRounds + _customAngle;
SoundManager.instance?.PlayClip("spinwheel");
// this is responible for the rotation of the wheel
iTween.RotateBy(_fortuneWheel, iTween.Hash("z", -_customAngle, "time", _wheelTime, "easetype", easetype));
iTween.MoveTo(_awardImages[_currentImageIndex], iTween.Hash("position", _centerPos, "time", _wheelTime, "easetype", easetype));
isSpinning = true;
yield return new WaitForSeconds(_wheelTime);
_fortuneWheel.transform.eulerAngles = new Vector3(0, 0, angles[wheelNo]);
isSpinning = false;
SoundManager.instance?.PlayClip("spinwheelend");
_lastImageIndex = _currentImageIndex;
_customAngle = noOfRounds - _customAngle;
_currentWheelNo = _nextWheelNo;
}
for (int i = 0; i < _awardImages.Length; i++)
{
if (i == _currentImageIndex) continue;
_awardImages[i].transform.parent = _content.transform;
}
_isStarted = false;
if (onSpinComplete != null)
onSpinComplete();
}
@xxmariofer I uploaded the code as per you request
Answer by xxmariofer · Apr 22, 2021 at 08:01 AM
I have downloaded your video, and used this web to make it 10 times slower https://ezgif.com/video-speed and I can tell you 100% that the wheel always runs in the same direction, but at the start is running 1 frame per number, and later atleast 8 or 9, so my only sugestion is using other pc, or if you need the app to run in low end pcs to do some performance
I need the application to run on a lower-end pc and I really don't have any choice in that, can you please tell me is there any way to achieve the rotation with code or something else?. And I really appreciate that you took the time to look into this problem, thank you so much.
You will need to use the profiler to know why exactly and what is running at a such slow framerate because it doesnt look like the issue is with in that code, even an old dual core cpu should be able to run it without issues. Although i dont know what Itween is and if it might be the responsable of the bad performance
Your answer
Follow this Question
Related Questions
iTweenEditor Make itween start from a trigger 0 Answers
rotation problems 0 Answers
Rotation animation worked in Unity 4.6, broke in 5.3.5+ 0 Answers