• I mean, you could just do:

    motor_ = block.getFieldValue("turnMotor_");
    if (motor_===undefined) motor_=0;
    

    So now you check that value inside Blockly.JavaScript.motor_move_by_vel - if it's undefined you set the default value.

    But what you were doing wouldn't work properly anyway - for instance if you make a bunch of blocks, and just the very last block doesn't have a motor set, all of the blocks will then have the motor set to 0 which I guess isn't what you want

About

Avatar for Gordon @Gordon started