if its not making the knocking when not ridden i doubt its the engine as would more than likely do all time,id 1st check for any thing loose like suspension,wheels,engine! flat tyre or buckled wheel,wheel bearings ,swing arm bearings etc
it hard to say without been near bike but fully check all the safty point before you try ride again!
i ad a similar knocking noise on classic car a few years back couldnt suss it out till one wheel passed me!i was lucky that no major damage happened and still had 3 wheels to 'coast' to a stop on a bike you might not be so lucky!
good luck and i hope its something simple for you