- Home /
How to say OR in C#.
I have some code and i want it to say that i can jump if im in two states. I mainly use JS so im a newb at C#. I want it to say that I can jump when in "locoState" (locomotion so i am moving) and in "idleState" (when im in idle) As you can see in my script below that its only for "locoState" and i want to include idle. Hope i made my question clear and Thanks in Advance!
if (currentBaseState.nameHash == locoState)
{
if(Input.GetButtonDown("Jump"))
{
anim.SetBool("Jump", true);
}
}
Answer by AlwaysSunny · Aug 28, 2014 at 12:22 AM
if (currentBaseState.nameHash == locoState || currentBaseState.nameHash == idleState )
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
How to Rotate Cube When jump? 1 Answer
Multiple Cars not working 1 Answer
When the player turns around the idle animation plays for one frame. 1 Answer
Same Animator, different clips for different objects. 0 Answers