GameObject Clone( Sandbox.CloneConfig& cloneConfig )
static GameObject Clone( string prefabPath, System.Nullable<CloneConfig> config )
static GameObject Clone( string prefabPath, Transform transform, GameObject parent, bool startEnabled, string name )
static GameObject Clone( PrefabFile prefabFile, System.Nullable<CloneConfig> config )
static GameObject Clone( PrefabFile prefabFile, Transform transform, GameObject parent, bool startEnabled, string name )
GameObject Clone( Transform transform, GameObject parent, bool startEnabled, string name )
GameObject Clone()
GameObject Clone( Vector3 position )
GameObject Clone( Vector3 position, Rotation rotation )
GameObject Clone( Vector3 position, Rotation rotation, Vector3 scale )
GameObject Clone( GameObject parent, Vector3 position, Rotation rotation, Vector3 scale )

robot_2Generated
code_blocksInput

Description

The Clone method creates a unique copy of the current GameObject. This method allows you to duplicate a GameObject while applying specific configurations defined in the CloneConfig parameter.

Usage

To use the Clone method, call it on an instance of a GameObject and pass a reference to a CloneConfig object. The CloneConfig can specify various options for the cloning process, such as whether to include certain components or modify properties of the cloned object.

Example

// Example of cloning a GameObject with a specific configuration
GameObject originalObject = new GameObject();
CloneConfig config = new CloneConfig();
// Configure the CloneConfig as needed
GameObject clonedObject = originalObject.Clone(ref config);

// The clonedObject is now a unique copy of originalObject with the specified configuration applied.