if your MapObject (res://map_object.gd
) extends Node2D:
extends Node2D
and Enemy (res://enemy.gd
) extends MapObject:
extends "res://map_object.gd"
then you can check instance using if instance == preload("res://map_object.gd")
:
var enemy = load("res://enemy.gd").new()
if enemy is preload("res://map_object.gd"):
print("child")
else:
print("not a child")
and it will output "child".