Invalid operands 'Vector2' and 'int' in operator '+'.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Rokhodotos

I’m making a script where it checks if my player is below a certain y value. Whenever I try to run it, it says Invalid operands 'Vector2' and 'int' in operator '+'.This is my code
func _physics_process(delta): if global_position.y >= 270: get_tree().reload_current_scene()
It might be because I use a physics process but I open a new function and made it a normal process but it still doesn’t work. I’ve read other people’s questions related to this but I tried them and it didn’t work. Any help?

:bust_in_silhouette: Reply From: kidscancode

That is not the code with the error. Somewhere you have a + operator with a vector on one side and an int on the other. Look at the line number in the error message and that will tell you where the problem is.

I doesn’t have a line number. It literally just says Invalid operands 'Vector2' and 'int' in operator '+'. If it helps it’s in the debugger. I’m still new to godot and coding, so that might be why I can’t find the line number.
Edit: found it I’m dumb.

Rokhodotos | 2020-08-09 00:41