Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | ferhand | |
Old Version | Published before Godot 3 was released. |
Yes, as I say in the title:
I have a node Creator to instance a StaticBody2D wich has as childrens a CollisionShape2D, with the circle2D shape and two sprites nodes.
What I do is:
var ball_node = preload('res://scenes/ballz/Ball.tscn')
var ball = ball_node.instance()
ball.bubble_texture = textures["bubble"][size]
ball.ball_texture = textures[type][size]
ball.set_pos(self.get_pos())
ball.__update()
self.get_parent().add_child(ball)
Inside the Ball node script it checks the bubble_texture size to set it to the radius of the shape2D.
Actually it does what should do, but each time a new Ball is instanced all the created ballz update de new bubble_texture size to their shape2D radius.
It is annoying to see all the balls move as if they were haunted…
Can someone help me??