desasteraang: Event 16 the parameter index needs to be a number.
Here strictly "0", not "Function.param(0)".
Make sure also to set the origin point for the obstacle for it to work as if it was resting on top of the block (likely setting it at the bottom of the object).
You also need to do a few modifications in the action that calls the function "obstacle".
You need to add a 4th parameter : "Block.UID"
And in the function "obstacle", add a condition (event 16) Pick Block by UID Function.param(4).
This will make sure to pin the obstacle to the newly created block and will prevent strange behavior from happening.