Greetings all! I'm not much of a programmer--I'm more of a modelling and art guy--so I need some help with this: I have a torch scene in Godot, complete with shadergraphs for flames, smoke, and the lighting, but need to add a fire sound effect. I have a looping fire sound effect, but I want to have the loop start from a random point in the audio file, so that every torch in the map doesn't sound exactly the same all at once. I'm not sure how to accomplish this in Godot, but I know that, in Unity, this bit of code that I found online worked for my purposes:
public class NewMonoBehaviourScript : MonoBehaviour
{
public AudioSource source;
// Play the sound file attached to this object starting at a random point in the track
void Start()
{
source.time = Random.Range(0f, source.clip.length);
source.Play();
}
}```
If someone that's knowledgeable about how C# works can parse this and get the gist of what I'm talking about, that would be rad.
Also, is AudioStreamPlayer3D the proper node for this in a 3D environment? I guess I'm not super familiar with how all the different audio nodes work, either.