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.
- Search this forum for posts on cloning, if you need support with that
- To attach an object to the camera using CoBlocks, you need CoBlocks to be enabled on the Camera
- You can attach an object to the camera using an Advanced CoBlock - add child object to object in Items > Modify
- 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.
- 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.
- Attach a knife object to the camera
- Change its opacity to 0%
- Clone it then change the opacity of the clone to 100%
- Re-do the same thing again.
I hope it helps. Good luck.
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
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”
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