- Home /
Question by
SterlingStudios · Jun 13, 2014 at 08:38 PM ·
gunif
Problem with "if" statements
Hi. I have a problem with multiple items under an "if" statement. I want all of these to happen. Here's the code:
function GunFX () {
if(Input.GetMouseButtonDown(0) && canShoot == true)
gunShotFX.active = true;
yield WaitForSeconds(1);
gunShotFX.active = false;
audio.PlayOneShot(gunShotSound);
}
Comment
Answer by supernat · Jun 13, 2014 at 08:59 PM
You need to put brackets around the entire group of statements {}.
http://introcs.cs.luc.edu/html/ifelse.html
or
Your answer
Follow this Question
Related Questions
Problem with "if" statements 0 Answers
Problem with "if" statements 1 Answer
gun problems 1 Answer
For some akward reason bullet is moving in the wrong direction 1 Answer
Refer to object class is attached to 1 Answer