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?