I wanted to do pixel art, so I made the following coding. But the cube is not dragged. What’s the reason? Please help me. Thank you.
Your Blockly script has an old variable called
drageditem. It uses no capital i in
drageditem while your actual variable is called
To fix this, try renaming your existing variable called
dragedItem like this:
I recommend using lower camel casing for all variable names to avoid naming problems for your variables.
Variables written in lower camel casing look like this:
Here’s how your code would look with lower camel casing variables:
Finally, to make your cube move on the item you have to make sure that you rotate the dragZone item so that its top-side is looking at the camera. The method
addMoveOnItemInteraction only makes movement on the top side of items possibe.
To fix this, simply rotate the cube like this:
Finally, you can continue with your pixel art project!
Hope this helps!