Question by
codedbythet · Oct 14, 2020 at 09:01 PM ·
scripting problemif statementif else
If Statement Help
I am trying to get this in to a if statement.
void Shoot() {
float angle = pm.isFacingRight ? 0f : 180f;
Instantiate(bulletPrefab, firingPoint.position, Quaternion.Euler(new Vector3(0f, 0f, angle)));
}
Something like....
void Shoot() {
float angle = pm.isFacingRight ? 0f : 180f;
if (something to open if statement)
{
Instantiate(bulletPrefab, firingPoint.position, Quaternion.Euler(new Vector3(0f, 0f, angle)));
} else if (second part)
{
Instantiate(bulletPrefab, firingPoint.position, Quaternion.Euler(new Vector3(-180f, -180f, angle)));
}
What I am looking for is "-|-" and I am currently getting "_|-"
Comment
Your answer
Follow this Question
Related Questions
How to put an if statement inside an if statement? 3 Answers
If/else statement is always else 1 Answer
NOT condition not working 1 Answer
Unexpected token: if HELP 1 Answer