I want to check if the player is near a door.
In practice, this means that I want to check if the Area2D of the player node overlaps a door node (an Area2D with an attached door.gd script). This is working in Godot 3:
player.gd
# ...
var door_type = preload("res://objects/door.gd")
# ...
for area in $Area2D.get_overlapping_areas():
if area is door_type:
# ...
door.gd
extends Area2D
# ...
However, in Godot 4 (v4.1.2) I have the following error:
"door_type" is a variable but does not contain a type.
I tried an Internet search for this error, but I did not find any result.
How can I achieve this behavior in Godot 4?