diff --git a/src/blocks/scratch3_control.js b/src/blocks/scratch3_control.js index 3f7a8e79b..4636d282d 100644 --- a/src/blocks/scratch3_control.js +++ b/src/blocks/scratch3_control.js @@ -144,15 +144,21 @@ class Scratch3ControlBlocks { } createClone (args, util) { + // Cast argument to string + args.CLONE_OPTION = Cast.toString(args.CLONE_OPTION); + + // Set clone target let cloneTarget; if (args.CLONE_OPTION === '_myself_') { cloneTarget = util.target; } else { cloneTarget = this.runtime.getSpriteTargetByName(args.CLONE_OPTION); } - if (!cloneTarget) { - return; - } + + // If clone target is not found, return + if (!cloneTarget) return; + + // Create clone const newClone = cloneTarget.makeClone(); if (newClone) { this.runtime.targets.push(newClone);