It’s supposed to send a ray cast from mochi/the player to the enemy/hook, and not activate if theres anything between them. But it doesn’t do that, even if theres a wall or something in between, it applies the force.
You need to put all the objects that can get in the way, plus the enemy/hook, into an object group. You then raycast against that object group. The raycast will return the first object from that group which it hits.
Then check that object’s name is that of the enemy/hook.