Why isn't the define block working..?

image
the number of inputs do match??

untitled script pic
this makes a block that says the input. honestly that's a pretty terrible error message
is there something different you're trying to do?

not sure why you're naming variables "looks", define doesn't let you set anything about the block other than one bit of label and inputs.

the (block) variable refers to the block you create with it, so you can do things like run it, set properties on it after, or make it recursive

image

oh, maybe you have a block that it's conflicting with?
or you need to reload snap because something broke again, like that weird FOR block from that other thread

no competing blocks and reloaded and still broken
image

is this an empty project? if it isn't, then try it in an empty project. if it works, share the project it doesn't work in

dont do that of the nam of a primitive

When you define a block you have to specify where the input slots go using underscores
untitled script pic (16)

alr changed the name, didnt work

a: why the hell do ur blocks look like that..?

b: THANK YOU!

right, i didn't run into this because i already had a block labelled say (from trying to set it up)
this is correct

@here ok now how do i set the category before the block is created..?

pretty sure you can only set it directly after with SET [category v] OF BLOCK () TO []

To set the category of a block, use the set [] of block () to [] block, with the block variable from the define block as the block input.

The category can either be a number, or a string. You can get both of those in (my [categories])

And just saying, if you already have a block with the same name as a block you create using scripts, it will just replace the block, not throw an error.

ok thx

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.