Has_method() doesnt work

Godot 4.3

# Test if a given node is of the specified class
static func is_xr_class(node : Node, type : String) -> bool:
	if node.has_method("is_xr_class"):
		if node.is_xr_class(type):
			return true

	return node.is_class(type)

This is a tool script that runs over a bunch of nodes and it keeps erroring saying “non-existent function is_xr_class” even though there is a check for that function beforehand.
It errors in the editor.

Can you post your full code of this tool script and some of these Nodes that it runs through?
Also your scene structure would be helpful.

Yeah, its not my code though its in the godot xr tools library GitHub - GodotVR/godot-xr-tools: Support scenes for AR and VR in Godot. This is where I got the code snippet from Im just trying to fix this annoying error

I don’t have the ability to test XR unfortunately, and I don’t see any obvious reason why this piece of code would fail.
You can open an issue on their GitHub page:

1 Like

If the given arguments don’t match, this can cause same error.

The error is actually in the editor its a tool script and every time it runs it checks like every node in my scene I have no idea what it’s doing but it’s just making this annoying error. I should have specified