Checking the type of the object in this way is not supported in Godot 4 as it errors out with "Could not find type "p_type" in the current scope.", since Godot is considering the parameter p_type as a pre-defined or defined name of a class such as Node, Object, GDScript, etc.
Therefore, we can check the type of p_obj by getting the class as string and seeing if it is equal to base type of p_type.
Checking the type of the object in this way is not supported in Godot 4 as it errors out with "Could not find type "p_type" in the current scope.", since Godot is considering the parameter
p_type
as a pre-defined or defined name of a class such asNode
,Object
,GDScript
, etc.Therefore, we can check the type of
p_obj
by getting the class as string and seeing if it is equal to base type ofp_type
.