Walking Sound help

I have a physics checksphere which is working perfectly for whether I am grounded and can jump. Then I have an empty game object with audio source with walk sound attached, then using this code to make walking sound:
"If(x != 0 || z != 0 && isGrounded)
{
StepSoundObject.setactive(true);
}
Else
{
StepSoundObject.setactive(false);
}
Now this works great except when my player is moving side to side while jumping the sound continues to play while I'm in the air. But works perfectly forward and back while jumping.
Any thoughts appreciated or even an easier way to apply this sound

&& is evaluated before ||
https://learn.microsoft.com/en-us/cpp/c-language/precedence-and-order-of-evaluation?view=msvc-170

You should add a parenthesis:

If((x != 0 || z != 0) && isGrounded)

I moved my code down in the update and changed it to the attached image to utilize my move vector3.
Also added a bool to check if jumping. Works now.

9711760--1387723--17109011599438585263006074430435.jpg

Thanks arachnid for that tip as any info like that which I can absorb is very helpful.