I jumbled a few Tutorials for my first simple game, and i have been able to solve all the problems i ran in to, but this is driving me nuts. I googled similar problems already.
I have 2 audio sources under my GameObject that i use as the character. They both play fine on awake. One plays fine from script. The other either doesn’t sound or gives a few clicks when called from script.
Here is the Script that i use for the audio that wont work ( the audio that does work is identical on my collision script)
audio play on line 33
audio varible on line 7
public class PlayerMovement : MonoBehaviour
public Rigidbody rb;
public AudioSource AudioFall;
public GameObject Fall;
public float forwardForce = 2000f; // Using a variable to manipulate the movement physics allows more freedom than apply a constant force
public float sidewaysForce = 800f;
// Update is called once per frame. Unity prefers FixedUpdate to Update when manipulating physic (i.e. Rigidbody)
void FixedUpdate ()
rb.AddForce(0, 0, forwardForce * Time.deltaTime); // Time.deltaTime basically alters the applyed force from happening
// per frame, and makes it more like per second. this is to cater to
// any speed of computer with your game.
if ( Input.GetKey("d") )
rb.AddForce(sidewaysForce * Time.deltaTime, 0, 0, ForceMode.VelocityChange);
rb.AddForce(-sidewaysForce * Time.deltaTime, 0, 0, ForceMode.VelocityChange);
if(rb.position.y < -1f)