Packed Scene Instantiater
by Yukana
Godot Addon - Packed Scene Instantiater
An Godot addon that helps you to quickly instantiate packed scenes in minutes.
(The word instantiater should be instantiator, but I mis-spelled the word and the incorrect spelling has been used extensively in this addon...)
Supported targets
Programming languages
- GDScript
Versions
- Godot: >= 4.3
- Redot: >= 4.3
Platforms
- Windows
- Linux
- macOS
- Android
- iOS
- Web
Preuse
Installation
- Download the release you want from
releases
and extract the addon folder to your Godot project'saddons
folder and cover the latter.
The language
Currently, the addon only provides support for GDScript, as this is the language that Godot uses for its scripting and easy for beginners to understand, which will help users to give quicker feedback and DIY their own solutions based on the addon.
Due to some technical limitations, you cannot inherit a C# class from a GDScript class, vice versa. Therefore, if you are using C# for long-term development, you may consider writing manually a C# binding for the addon.
Meanwhile, the custom classes in this addon are expected to be sealed, which means that they are designed with unextendability, so it is not supposed to make any derived classes from the custom classes in the addon.
For users who are developing games with C#, or making games with hundreds or thousands of instances instantiated in one second, please consider object pool instead of this addon, as this addon does not support pooling.
What is Packed Scene Instantiater?
Packed Scene Instantiater is an addon that provides two parts of global types: Instantiater
and Instantiater*D
. They works together to allow you to quickly instantiate packed scenes, saving your time and effort from making wheels during your game development.
Instantiater
An Instantiater
is a library static class that provides a further-encapsulated method, new_instance()
, and some extra methods to help with instantiation. The method requires the first parameter to be a PackedScene
from which you are going to instantiate an instance, and you are allowed to pass in a callable into callback
parameter for the futher and customized instantiation. By default, the callback is called right after the instantiation of packed scene. You can also customize the occasion of the call by setting the parameter callback_occasion
.
The instances created from the packed scene via the method are not added to the tree, so you need to call add_child()
or add_sibling()
to accomplish the task. For 2D and 3D game developers, see Instantiater*D
helper nodes.
Instantiater*D
Instantiater2D
and Instantiater3D
are helper nodes that provides a convenient way to instantiate packed scenes in the 2D or 3D space. To create the instance, you can call new_instance
of the helper node, and it will also automatically add the instance to the scene tree as the sibling of the parent node of the helper.
You can also preview the instance that is going to be created from the packed scene in the editor. Therefore, the instantiation will become visual and more simple. This is extremely useful for artist game developers.
Used fonts in logo
- Cyberion Demo
- Dunkin Sans
Credits
- 悠鱼/咸鱼/幻灭者001·Yukana(@Lazy-Rabbit-2001): Main programmer and designer, logo designer.
- Godot: Icons of the
Instantiater
,Instantiater2D
andInstantiater3D
. - Letterhend Studio: Designer of the font Cyberion Demo.
- Neale Davidson: Designer of the font Dunkin Sans.
Download
Support
If you need help or have questions about this plugin, please contact the author.
Contact Author