Trying to implement an if or statement

Hello everyone,

I think my issue here is simply one of placement, and would be appreciative and humbled if someone might be able to provide an assist. I’m trying to implement an or if statement, and can’t seem to find a lot of documentation on them. (found one, which I tried using, but am running into an error) Here’s my statement:

if(GUI.Button(Rect(400,775,100,50),"Yes"))||if(Input.GetButtonDown("Action")){

(if you need more code, no problem, but I figured that the issue is probably all contained in that line)

All I’m trying to do is allow either a click of the GUI button OR the gamepad “action” button to do the action. Currently I’m getting an “unexpected token” error at the ||. Thanks for any assistance. God bless.

You only need to use ‘if’ once in a statement like this. Also, keep the entire statement in a single encapsulation. if(this || that){//DoSomething}; This particular case isn’t really best to use in GUI code.

 if(GUI.Button(Rect(400,775,100,50),"Yes") || Input.GetButtonDown("Action"))
 {
     //DoSomething;
 }