- Home /
CharacterController.isGrounded script error
I'm trying to make a sound play when the player is grounded but only play the sound once. I've done this before, but I can't remember how I did it. Anyhow, here's my script:
var PlayerController : CharacterController;
var Landing : AudioSource;
function Update () {
if(PlayerController.isGrounded == true){
Landing.audio.Play();
}
else
if(PlayerController.isGrounded == false){
}
}
How much whitespace does it take to make code unreadable???
I think you've answered that question...
Please make your code readable before asking questions about it :)
I don't think you understand: when I hit space and I was on the ground just before that, then the landing sound plays.
@TheRichardGamer Did you read what I said. Format your code properly before I answer your question
Your answer
Follow this Question
Related Questions
CharacterController doesn't rotate on my script... 1 Answer
Character keeps moving in one direction on its own 4 Answers
Should character direction come from key press, or third person controller vector3? 0 Answers
How do I solve this error? 2 Answers
The name 'Joystick' does not denote a valid type ('not found') 2 Answers