Hi everyone

I'd like to write a program that spawns a square at the top of the screen, moves the square towards the bottom, deletes the square and then spawns a new one at the top of the screen again.

This is what I have so far

The program only runs without the if-statement. It continuously spawns squares.

If I include the if-statement, it get the message:

What does that mean and how can I fix it?

Thanks

Wrong tags. This should be in help.

As for the actual issue, the error tells you the problem: you're trying to call a function, is_on_screen, that doesn't exist in Area2D classes. It's unique to VisibilityNotifier. You'll need one of those set up in your instanced scene, and a reference to its node, to use that property.