novemberdev / novemberdev_object_pooling_godot Goto Github PK
View Code? Open in Web Editor NEWObjectPooling Plugin for Godot
License: MIT License
ObjectPooling Plugin for Godot
License: MIT License
Hi i love your object pool and am using it to great effect but I seem to have encountered a bug or I'm doing something wrong,
But when kill a node and call the ObjectPooling.queue_free_instance(self) command it sometimes gives the error :
Invalid set index "global_transform ( on base: "Area2D ( Asteroid_new.gd)) with value of type Vetor2,
If i comment out the commented out the if instances is Node2D: part i don't get this error and all seems to be working fine for now, but I'm not fully sure what that bit of code does and how to otherwise fix this bug. Would you know what the problem is?
`func toggle_instance_activation(instance, activate):
recursively_activate(instance, activate)
if instance.has_method("on_object_pooling_reset"):
instance.on_object_pooling_reset(activate)
if !activate:
instance.get_parent().call_deferred("remove_child", instance)
if instance.has_meta("scene_path"):
if instance is Spatial:
instance.global_transform = object_pool[instance.get_meta("scene_path")].props.transform
if instance is Node2D:
instance.global_transform = object_pool[instance.get_meta("scene_path")].props.transform
pass
if instance is Control:
instance.rect_global_position = object_pool[instance.get_meta("scene_path")].props.position
instance.rect_rotation = object_pool[instance.get_meta("scene_path")].props.rotation
instance.rect_scale = object_pool[instance.get_meta("scene_path")].props.scale
instance.rect_size = object_pool[instance.get_meta("scene_path")].props.size
instance.visible = activate`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.