Is my translated function from BP to C++ is correct?

I want to know if I translated the function correctly.

if (!_bHoldWeapon && MoveForwardAxis != 0.0f || MoveRightAxis != 0.0f)
{
//Some code
}else
{
//Some code
}

Wrap the last two conditions in brackets and you’re all set.
if (!A && (B || C))

1 Like
Consider doing this that way.

if (!_bHoldWeapon)
{
      if(MoveForwardAxis != 0.0f || MoveRightAxis != 0.0f)
              {
                         //Some Code
              }
        }else 
        {
        //Some code
        }
1 Like

Thank you for the solution works perfect )

Thank you for the solution works perfect )