Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Thakee Nathees |
I have created a custom node like below
extends Area2D
class_name CollisionArea
func _ready():
connect("area_entered", self, "on_area_entered")
func on_area_entered(var area):
print( area.get_class() )
when ever 2 CollitionArea nodes collides it prints “Area2D” but I want the custom class name ( CollisionArea ) to be printed, is there any way to get the name? (i don’t want to use the node.get_name() because names often change)
Have you tried “Object.get_class()” ?
AlMoeSharpton86 | 2019-06-05 22:45