This Topic is for anyone who needs help with CoBlock code

Anyone who needs help with CoBlocks should post their queries here. I am happy to help.

:blush:

i need help with coding a deer and a bottle and 2 glass

ok what will these things do?

i want the dear to do siting and standing animation and the bottle and the 2 glass to be pick’t up

ok ill try to do that

thank you so so much

Picked up by what. Do you have any other details? Cuz there is not much to work with,sorry

oh yea and it’s ok. so the dear gos in to a siting position when you put/touch and then it’ll stand when you stop put/touching the dear. The bottle and glass’s you are able to pick up and if you put the bottle upside down liquid will pour and if you take the glass’s and put it under the bottle they will fill up.

I need help to make code where when you click a object spawns there

Hi @Matthew_Leach, please search the gallery and these forums for “spawn” - there are plenty of examples you can use as guides.

Hi @Donut_Dasher
Can we design and construct virtual bridges using different materials and configurations by gamifying it using COBlocks?

im makeing a game like minecraft but i cant get it to delete blocks and i dont know how to fix it theres a error that says “Argument of type ‘boolean’ is not assignable to parameter of type ‘() => void’."
the game is CoSpaces Edu :: cocraft

Hi Matthew,

I couldn’t actually delete the cubies, but I managed to put the last created block under level 0 so no one can see it. Presumably you want to use the ‘space’ button to ‘delete’, the code would be:

function shiftUnder() { cubie.transform.position = cubie.transform.position.add(new Vector3(0,0,-10))}
Input.onKeyPressed(() => {shiftUnder()}, 'space')

You can paste this snippet at the end of the Typescript tab.
For “deleting” all the created Minecraft blocks you would need a different code. Let me know if this was helpful to you.

thank you for the code I have been trying for a while

but do you know how to delete a block I raycast from my mouse cursor

function shiftUnder() {
cubie.transform.position = cubie.transform.position.add(new Vector3(0, 0, -10));
}

Input.onMouseButtonPressed(MouseButton.Right, shiftUnder);

or
function shiftUnder() {
cubie.transform.position = cubie.transform.position.add(new Vector3(0, 0, -10));
}

Input.onPointerEnter(cubie, shiftUnder);

thanks for helping’.

1 Like

can someone please help me out with this…Can we design and construct virtual bridges using different materials and configurations by gamifying it using COBlocks?