Gds script claim to be assigned to type label after the node was changed to richtextlabel

Godot Version

4.2

Question

I changed a label node in my game by directly changing its type instead of creating a new node and something funny happens. the script I attached to the node first crash due to error of being assigned to richtextlabel as I didn’t fix what it extends to, yet when I changed

extends Label

to

extends RichTextLabel

It proceeds to crash and claim the script is inherited from RichTextLabel and cannot be assigned to object of type label
Whats even worse is when I giveup and decides to create a new RichTextLabel node and copy all the feature from the old label one by one then attach the script. The script still regard the richTextLabel node as a label node. Please help

looks like the changing before the first crash didnt save. I recommend to remove the script from the node → then change the type to richtextlabel → change the script to “extends RichTextLabel” → attack the script to the node again

For future reference: when you change the extends clause, you also need to change the node type in the Scene tab:

This works, I also find I made a mistake by attaching the script on other node that are not changed to richtextlabel yet. Which explains why either way of extends fails.

1 Like