How to create clone? Using typescript

Hi i have some Idea to create clone by typescript.
This is code example:

const Item = Scene.getItem(“vaDDeewY”) as Cuboid

Input.onkeydown(createclone,‘right_mouse_button’)

function createclone (){
Time.schedule(()=>{
let copyItem = Item.copy()
Time.schedule (()=>{
copyItem.delete()
},1)
},1)
}

Thank for watching:)
you can use this code for shooting game or anything you need.

4 Likes

Nice one Henry! Here’s an advanced example of the same thing:

2 Likes

Thank for solution! :slight_smile:
Your code have some bug :
The blocks stack on top of each other in the same position

Hope you fix that!
:slight_smile:

1 Like

Lol, that’s a feature, not a bug :blush: They are supposed to stack, like Minecraft.

1 Like