+2 votes

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

in Engine by (180 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")

and:

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

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

by (43 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 Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.