No operator "!=" matches these operandsC/C++(349)

I don’t know why I have this problem and how to fix it. I tried using “direction.x & direction.y != 0.0” but it didn’t work either!

The key would be right here

image
There’s no function available that overloads the != operator that takes a Vector2 on the left and a double on the right.

If you’re wanting to check if a Vector2 is zero based on your first attempt, you’d want to make this comparison.

if( direction.x != 0.0 && direction.y != 0.0)

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms