Grappling hook & surface types

I’m making the same type of 3rd person grappling hook as in this video:

https://www.youtube.com/watch?v=aphg7Nl7Rn0

But it lacks any hookable surface types, the hook attaches on everything on the map. How do i make the grappling hook attach to only a certain types of surfaces?