Invalid operands 'float' and 'Object' in operator '>'

Godot Version

v4.2.stable.official [46dc27791]

Question

Hi!
Im trying to make a script that flips my character sprite when I move my mouse to the left of my players position but keep getting this error on my 4th line:

image

been trying to get this to work for a while now, kinda new programming so any help is very appreciated!

You are comparing mouse_position.x (a number) to player_position (a Vector2).
Did you mean to use player_position.x?

1 Like

Yea thanks man! Kinda mad that i didnt see that for like an hour.
Also forgot to add .get_position() at the end of line 3

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