Bro I'm SO SO SO sorry to bother this amazing community once more. My code has the "invalid operands "float" and "vector 2" for "-" operator"

This is my code

You try to take an float (the y-position) and subtract a vector2 (the position). You should add a “.y” after .position
Vector2’s look like this (0.0,0.0) while if you only access an x,z or y they look like 0.0 So if you try to take e.g. (100.0, 90.0) - 10.0, Godot will not know if to sub 10 from 100 or 90

2 Likes

It worked thank you so much, man. This helped me get back up with my first ever game. Bro, your truly a amazing human being, god bless.

1 Like

No worries! Glad it helped!

1 Like

You should mark baba’s answer as the solution, for record-keeping purposes.

1 Like

Also, you don’t need to apologize in the title. Just make it about the issue you’re having. We are all here to help each other.