if statements are running when they are not suppose to be
I am creating a novel game in c#. The problem is that I have two if statements, both do seperate things. I have two buttons, a yes and a no button. The buttons both trigger a sperate bool, a response 1 bool and a response 2 bool. I then have an if statement for each one. Such as: The main problem is that both if statements run even when only one should. Anyone know any fixes.
Answer by Insok · Nov 22, 2020 at 01:50 PM
Hi,
You might have figured it out by now, but your syntax is not entirely correct.
Instead of ResponseOnePressed = true
, you should use either
if (ResponseOnePressed == true)
or
if (ResponseOnePressed)
Your answer
Follow this Question
Related Questions
Help with rotation please 2 Answers
Call a function When a bool changes value? 2 Answers
Weird problem with simple boolean and "if" statement [C#] 0 Answers
how do i say this 1 Answer