Create a Node2D, then add a Label node as its child
Attach the script to the Node2D
Copy and paste the script content into it
Select the Node2D and specify the root node in the right-side panel
Other parameters are adjustable as needed.
Extra Notes
Thanks for the official update, meow! Finally, I managed to make a dynamic damage display with AI, meow! I use the invincibility toggle to trigger the damage text animation. The invincibility cooldown interval is used to control the spawn rate of the damage text. Thanks again to the official team, meow!
2.5:
Now damage text will pop up on taking hits even after scene switching, including when teleporting via portals or switching scenes through scene connections.
This also applies to objects pre-placed in the scene.
For the Act Game Maker Compatibility Mode on the right panel, simply check the boxes for [Use Act Game Maker] and [Auto Detect Scene Changes] (or keep all settings as default).
How to Update the Script
First, close all other object scenes that have already imported this script.
Copy the new script and replace the original one.
This will automatically reset all scenes that have loaded this script to their default values.
If the target scene is open during the update, you need to make the changes manually.