I have a suspicion that you're mixing up "FixedUpdates" with "Updates" in the code. A lot of in-game events just don't trigger on certain frames. Platforms sometimes don't register, enemies sometimes don't register, block hits very frequently don't register.
For example, the code for floating blocks should just be something along the lines of:
void OnCollisionEnter2D(Collision2D collision) { if(collision.gameObject.tag == "Mario") { GameObject mario = collision.gameObject; //assuming that the origin is set at the bottom of the block if(mario.transform.postion.y < this.transform.postion.y) Debug.Log("Mario hit a block"); else Debug.Log("Mario did not hit block"); }
That being the case, I don't understand why spinning on top of a block hits it, why enemies can hit blocks, or why the hits only count from certain angles and on certain frames.
Mario should not slide around or have his sprite rotate. Lock all axis rotation in his RigidBody. Check to see if you're using a frictionless physics material for the blocks. Otherwise you're adding a force to the Mario gameObject at some point when you shouldn't, it seems to be related to holding shift.
I reached the boss this time around but his claw attack didn't get cleaned up by the game engine giving him a permanent shield.