![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | IndigoGames |
How to use duplicate() function? Documentation is kind of vage and i want to know how to use the DuplicateFlags.
![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | IndigoGames |
How to use duplicate() function? Documentation is kind of vage and i want to know how to use the DuplicateFlags.
![]() |
Reply From: | jgodfrey |
I haven’t used it, but it seems to be documented well enough.
The basic use is var newNode = $YourTargetNode.duplicate(DupFlags)
The DuplicateFlags
is an optional argument that defines some of the details about the duplication. Those are documented here:
As documented, the default value of the argument is 15
if you don’t specify it. If you look at the DuplicateFlags
doc, you’ll see that it’s an enum, each with a unique “bit” value.
The default value of 15
is really just the all of the enum values added together (8 + 4 + 2 + 1). So, the default value duplicates everything from the target node. If you don’t want to duplicate some of those things, just don’t specify them in your argument.
For example, if you wanted to duplicate everything except the scripts, you’d specify a value of 11
(8 + 2 + 1) - leaving out 4
, which represents script duplication.