0 votes

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

Godot version 3.2.3
in Engine by (22 points)

1 Answer

0 votes

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.

by (86 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.