![]() The active status of a GameObject at the time of cloning is maintained, so if the original is inactive the clone is created in an inactive state too. If the position and rotation are specified, they are used as the object's position and rotation in world space. If a parent is specified and no position and rotation are specified, the original object's position and rotation are used for the cloned object's local position and rotation, or its world position and rotation if the instantiateInWorldSpace parameter is true. However, you can still set the parent using the overloaded methods. By default the parent of the new object is null it is not a "sibling" of the original. If you exceed more than half your stack size, Unity throws an InsufficientExecutionStackException. To prevent stack overflow, Unity limits this nested cloning. Note: When this method clones a child object, it also clones the child's own children. ![]() ![]() When you clone a GameObject or Component, all child objects and components are also cloned with their properties set like those of the original object. ![]() If you are cloning a Component the GameObject it is attached to is also cloned, again with an optional position and rotation. If you are cloning a GameObject you can specify its position and rotation (these default to the original GameObject's position and rotation otherwise). This function makes a copy of an object in a similar way to the Duplicate command in the editor. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |