Search Unity

How to make a Grapple Hook/Rope Swing

Discussion in '2D' started by Leandro95, Apr 7, 2015.

  1. Leandro95

    Leandro95

    Joined:
    Mar 18, 2015
    Posts:
    16
    Hi,

    I'm looking to implement grapple-hook or a ring swing in my current project and wondered if anyone knew of any tutorials etc?

    i'm thinking it would work in a similar fashion to the hookshot in the zelda series

    if so, i'd do something like this:

    Raycast from player position to target
    Store raycast hit in a Vector3
    transform.translate from current position towards Vector3 * speed
     
  2. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    @Sykoo was working on a rough prototype for a grapple hook.
    I don't know how far he got.
     
  3. Sykoo

    Sykoo

    Joined:
    Jul 25, 2014
    Posts:
    1,394
    I got a little more far than this :p
     
  4. Sykoo

    Sykoo

    Joined:
    Jul 25, 2014
    Posts:
    1,394
  5. Leandro95

    Leandro95

    Joined:
    Mar 18, 2015
    Posts:
    16
    Thanks man i will check it and try to understand all of your code
     
  6. Sykoo

    Sykoo

    Joined:
    Jul 25, 2014
    Posts:
    1,394
    It's commented very high quality and in-depth so you'll have a great ease of understanding it :)
     
  7. genelikespie

    genelikespie

    Joined:
    Aug 8, 2015
    Posts:
    1
    Hey Sykoo, do you still have the grapple hook package? I was having trouble when I was trying to open it up :(

    Thanks!!!! :)
     
  8. Sykoo

    Sykoo

    Joined:
    Jul 25, 2014
    Posts:
    1,394
    Hey! You can download it through this link:
    https://mega.co.nz/#!UlJUwZBK!G_CDL41heGBJnaPSGlA8sH0nu7S-FR00jaroCVqvA5g

    I re-exported the package as there were some issues after Unity 5. But now it should work correctly. :)
     
  9. mdhvgpta

    mdhvgpta

    Joined:
    Sep 2, 2015
    Posts:
    3
    Hi, I am trying to implement your hook system to get a batman like grapple hook in my game in a 3d environment. The hook is getting fired but its not attaching to the HOOK_PLACE object in the scene.
    Sorry I am new to unity programming.
    Thanks!
     
  10. Sykoo

    Sykoo

    Joined:
    Jul 25, 2014
    Posts:
    1,394
    Hey!
    My grappling hook is not made for 3D but it can be optimized by just a little tweaking, unfortunately I don't have time to work on it at the moment! :/

    For your issue, I'd suggest you to take a look at tags etc.
    I don't remember a lot of the method I used for the script as it was quite long time ago I created it. If you have any further questions, please don't hesitate to ask! :)
     
  11. CooperativeYogi

    CooperativeYogi

    Joined:
    Mar 24, 2016
    Posts:
    2
  12. Sykoo

    Sykoo

    Joined:
    Jul 25, 2014
    Posts:
    1,394
    I'm not sure if the asset has to be fixed - if it does I'll probably wait until I get some free time.
     
  13. MetaMythril

    MetaMythril

    Joined:
    May 5, 2010
    Posts:
    150
    Would you mind reposting the link anyway? I wouldn't mind checking it out even if I have to make some fixes.

    Thanks!