Skip to content

Puppets

Slashscreen edited this page Apr 19, 2023 · 1 revision

TODO: This

Reparenting Puppets

Puppets are, by default, parented to the PuppetSpawnerComponent that spawned it. However, they can be un- and re-parented at will to allow for cases where parenting is useful, like moving platforms. The puppet will maintain a reference to the PuppetSpawnerComponent that spawned it as the puppeteer member. An easy built-in way to get the entity associated with a puppet or any of its children is SkeleRealmsGlobal.get_entity_in_tree() which will automatically take puppets into account when crawling up the tree in an effort to get an entity. To make your own Puppet type that has this functionality, simply have a func get_puppeteer() method that returns a reference to the PuppetSpawnerComponent or an Entity (although the built-in puppet types return a PuppetSpawnerComponent, so that is the convention).

Clone this wiki locally