How to respawn objects and/or create clones

Im trying to make it so when I press R I throw a knife, and after a second another knife regenerates in my hands (attached to the camera). I have tried cloning it but I can’t find another block to attach it to? also it would help to know how to teleport objects to other existing objects.

Hi @Rowan_Ackerman,

  1. Search this forum for posts on cloning, if you need support with that
  2. To attach an object to the camera using CoBlocks, you need CoBlocks to be enabled on the Camera
  3. You can attach an object to the camera using an Advanced CoBlock - add child object to object in Items > Modify
  4. In order to have the knife return to the same place every time, I suggest you save the position of the knife in a variable at the start of your code.
  5. Teleporting an object to another object is simply setting the position of an object - you can use Advanced CoBlocks in Transform > Position, Data > Values, and Operators > Math to achieve this.

Hope that helps!

Here is a little trick.

  1. Attach a knife object to the camera
  2. Change its opacity to 0%
  3. Clone it then change the opacity of the clone to 100%
  4. Re-do the same thing again.

I hope it helps. Good luck.

1 Like

Yep - so many ways to achieve what you’re wanting @Rowan_Ackerman - that’s the cool thing about coding!