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!
Geoff

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!

hi how do i use the clone in coblocks?

Please open another topic about this I am making a video on how to do that.

Check this cospace, it explains how to

Greetings.

Here’s another:

hi @tajajtsidi i want to use the same concept of your code but when i spam e (e is to shoot a gun)
the copy wont delete and i will stay at the destination wich can be used to get “infinite points”

-Isaac :grinning:

try to set the button “e” to up and not to press, it should work.

it is on up but here is a remixalbe version maybe you can figure it out CoSpaces Edu :: shooting gun

oh and the Zombie/Vampire doesnt die when hit