0 votes

How do you duplicate/clone a model which is from CSGBox? I wanted to clone more than one on an original model. Here is the code what I did:

while not f.eof_reached(): # iterate through all lines until the end of file is reached
    var line = f.get_line()
    if line != "":
        line += " "
        var CSV_data = line.split(",", true, '0') ##splits into value array per line
        $RigidBody/box.width = int(CSV_data[3])
        $RigidBody/box.depth = int(CSV_data[4])
        $RigidBody/box.height = int(CSV_data[5])
        $RigidBody/box.transform.origin = Vector3(CSV_data[0],CSV_data[1], CSV_data[2])
        duplicated_model.transform.origin = Vector3(0,0,0)
        index += 1

This doesn't work. I don't think it'd work either. Is there any way for me to make a clone or duplicate without needed to do it in GUI?

Godot version 3.2.2.rc.custom
in Engine by (83 points)

Please log in or register to answer this question.

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 [email protected] with your username.