+2 votes

How can I take a sample of an object?
Like a hundred squares coming down from the top of the game scene

asked Jul 9 in Engine by abbos (27 points)

I'm not sure what you mean by "take a sample of an object". Maybe you can provide some more detail?

To copy a large number from one (kinematicBody, sprite, collisionshape) but in script

1 Answer

0 votes

If you want to create a lot of them from script you can do:

var MyNode = preload("path/to/the/node.tscn")


var new_node = MyNode.instance()
#if you want to change something in the node (for example the position here):
new_node.position = new_position

to instance one. Then just use a for loop to create hundreds of them.

answered Jul 16 by Siandfrance (39 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.