Obi Official Forum
Suggestion / Idea Rope grapplig hook - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html)
+--- Thread: Suggestion / Idea Rope grapplig hook (/thread-2417.html)



Rope grapplig hook - illustrator - 11-08-2020

Hi

Is it possible to limit the grappling hook grab distance? If not could you improve the script Grappling hook script to allow this?


RE: Rope grapplig hook - illustrator - 12-08-2020

(11-08-2020, 07:10 PM)illustrator Wrote: Hi

Is it possible to limit the grappling hook grab distance? If not could you improve the script Grappling hook script to allow this?

Forget about this. I'm not much of a programmer but I found this:

https://docs.unity3d.com/ScriptReference/Physics.Raycast.html


In GrapplinHook.cs: I just added a public float RopeLength and added that as a paramater to the raycast:

...

// Raycast to see what we hit:

        if (Physics.Raycast(ray, out hookAttachment, RopeLength))


...