![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | curtking |
I’d like to create a reusable component that has images and scripts. For example, a dice component that would have six PNG images, one for each die face. There would be a script with a handful of functions, nothing huge. I could create a project for this component, build the functionality, then copy over the scene and assets to a new project.
The problem is that the TSCN file points to the images relative to the project root, which breaks when the component is being used in a different project structure. For example, the TSCN file for the component might point to res://images/die1.png, which might not resolve correctly when used in another project. I could fix the broken references each time, but I’d prefer not to.
Is there a best practice for building components that contain assets like images, scripts, etc?