I think this will fix the problem:
At line 19. You have screen_size = get_viewport_rect(), where as you need screen_size = get_viewport_rect().size.
That should fix the problem, as then you’ll be using the Vector2 for size, which does have a Y member. You can also replace screen_size.y at line 30 with screen_size.size.y, but if you want to keep it the same as the tutorial then it’s probably best to change line 19 instead.