Hello , for days i’ve been trying to fix ‘fortune wheel sound latency’ on my iphone device. in my app there is a fortune wheel part and it works well on desktop with all features(physics sounds etc) .there is a spinarrow as in image , and this arrow has a box collider and it is a trigger object and when triggers to white circles around the wheel , the ticksound plays .(ticksound is a audiosource component of spinArrow)
i have 2 files , spinarrow.cs and spinwheelcontrol.cs …
public class SpinArrow : MonoBehaviour
{
private AudioSource audioSource;
private void Start()
{
audioSource = GetComponent<AudioSource>();
}
private void OnTriggerEnter2D(Collider2D collision)
{
if (collision.gameObject.CompareTag("spinTickObject"))
{
audioSource.Play();
}
}
}
public class SpinWheelControl : MonoBehaviour
{
private void spinWheelObject()
{
if (GameItems.isButtonEnabled)
{
wheelObject = spinWheel;
GameItems.isButtonEnabled = false;
AudioSource.PlayClipAtPoint(buttonSound, uiCamera.transform.position);
//creating angle array for randomly choice of player
int[] angles = { 0, 36, 72, 108, 144, 180, 216, 252, 288, 324};
//creating reward array for randomly choice of player
int[] rewards = { 150, 450, 100, 250, 300, 500, 0, 50, 350, 200 };
int index= Random.Range(0, angles.Length);
int rotValue = 1080 + angles[index];
float val = (float)6 / (rotValue / 36);
int sayac = (int)rotValue / 36;
spinWheel.transform.DORotate(new Vector3(0, 0, rotValue), 6, RotateMode.FastBeyond360).SetEase(Ease.InOutSine)
.OnComplete(rotateCompleted);
// .OnUpdate(updateTween);
void rotateCompleted()
{
//destroy component
Destroy(gameObject.GetComponent<AudioSource>());
//cache rewardvalue
rewardValue = rewards[index];
//clear arrays
angles = null;
rewards = null;
//stopcoroutine
// StopCoroutine(makeTickSound());
//showSpinResult to player
showSpinResult(spinWheel, closeFrameButton, spinButton,gravitySound,buttonSound);
}//rotate completed
}
}
}
I made rotation animation with dorotate function …
spinWheel.transform.DORotate(new Vector3(0, 0, rotValue), 6, RotateMode.FastBeyond360).SetEase(Ease.InOutSine)
.OnComplete(rotateCompleted);
// .OnUpdate(updateTween);
but unfortunately the onUpdate method didnt play sound well (very big sound latency) onios …
as coming to sound properties , its like this .
and at the last it tried to change audio latency properties from edit->projectSettings.-> audio , it didnt work again .
i hope i would fix this , is there anyone who could suggest anyother solution about this problem ?
by the i dont know whether it makes the same problem on android devices or not ??
Thanx



