![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Pyhrrous |
I’m running into an issue where scripts don’t seem to be checking what other scripts inherit from properly. Here’s my code:
Script A:
extends "res://Objects/Parents/Prt_Object.gd"
func _ready():
print("A: ",self is root_script)
Script B:
extends "res://Objects/Parents/Prt_Object.gd"
func get_hit(other):
print("B: ",other is root_script)
Prt_Object.gd:
onready var root_script = get_script()
However, when I test this and run get_hit
from Script B (with the node Script A as its argument), in the output I get:
A: True
B: False
Is there a proper way to test for inheritance that I’m not doing here?