Raycast grappling hook

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By taha

I have made a grappling hook with raycast
But the hook is working on everything
How can i Specify the colloding block

Like if colloding in blue block

:bust_in_silhouette: Reply From: StopNot

I can’t give you a very detailed answer because I don’t know how your code looks… but you could attach a script to every object you can use the grappling hook with. Put a method into the script and then check in your raycasting code if your target has_method("your_method_name"). This was from the top of my head. There’s probably dozens of more elegant ways to implement the same functionality.