if you create the RigidBody in a scene you can make a reference to it with
var block = preload(the file path goes here, you should be able to type the scene name and it'll autocomplete)
then when you want to duplicate it you do the following code
var blockInstance :Node3D = block.instantiate()
add_child(blockInstance)
after calling add_child() you can change things of blockInstance like it’s size and position.
(is it ironic that I’m making this reply while I’m having my own issues with add child)
Hello again, I implemented what you told me and I get this error: Stack overflow (stack size: 1024). Check for infinite recursion in your script. I don’t know how to fix it.
Sorry for being so annoying, but I’m pretty new to this and there are things I still don’t understand.
You should call instantiate() from outside of the scene.
The code you currently have is instantiating another block whenever a block is instantiated. This results in infinite self-instantiation - hence the stack overflow error.
Sounds like a good idea. Only that it’d be better for the main game logic script do the duplication, precisely to avoid the stack overflow problem we’ve discussed earlier.