help converting simple js to c code

hello
can someone please help me , i tried but always get a syntax error

float minPitch = 1.0f;
float maxPitch = 2.0f;

public void PlayRandomPitchSound(AudioClip clip)
{
float randomPitch = (Random.Range(minPitch, maxPitch));
audio.pitch = randomPitch;
audio.PlayOneShot(clip);
}

Try that. I’m not very profecient at C#, but I think that should do the trick (Oh, and also ofc place it in a class)

There is this very handy tool that might be useful in your case.

http://www.m2h.nl/files/js_to_c.php

thank you guys :slight_smile: