Giter VIP home page Giter VIP logo

novemberdev_object_pooling_godot's People

Contributors

novemberdev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

novemberdev_object_pooling_godot's Issues

Issue with object pool when destroying objects sometimes.

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`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.