It is said that I can change the starting time of an audio clip using AudioSource.time. But as long as I change the value, the clip just starts at the beginning, while the value of AudioSource.time is not zero.
Can anyone figure it out?
Greetings, @jmblb233. I cannot reproduce your problem. Here is my version of the code that works fine:
using UnityEngine;
public class AudioManager : MonoBehaviour
{
[SerializeField] float startTime = 0;
AudioSource audioSource;
void Start()
{
audioSource = GetComponent<AudioSource>();
audioSource.time = startTime;
audioSource.Play();
}
}
I can change the start time in the Inspector and the audio starts at the correct place. Perhaps show us your codeā¦?