This question was
closed Oct 06, 2016 at 11:52 AM by
RangerDog for the following reason:
Found out what the problem was by myself!
Question by
RangerDog · Oct 06, 2016 at 11:48 AM ·
ifif statement
If/ElseIf never reaches elseif
Alright, Supernoobquestion ._.
Basicly, i'm calling this code in Update:
void CheckTime()
{
Debug.Log(currentTime.value);
if (currentTime.value > 5 || currentTime.value < 18)
{
Debug.Log("Hi, Im Day!");
} else if (currentTime.value < 4 || currentTime.value > 19)
{
Debug.Log("Suppp, Im Night!");
}
}
Anyways, now it only returns that it is day, currentTime.value does give values ranging from 1 to 24, And i have truly no idea, even tough its probably something superobvious...
Thanks in advance!
Comment
Well shit, solved it!
For if you come to this question, answer was:
the else if should have been turned around, and || to &&
Follow this Question
Related Questions
My "if" statement doesn't work? 2 Answers
If statement for direction the character is facing 0 Answers
C# autocorrects my if statements 2 Answers
How to use or statements in an if statement. 1 Answer
Use of if(Component) 1 Answer