Announcement

Collapse
No announcement yet.

Grappling Hook Aim Assist

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Grappling Hook Aim Assist

    Currently, I've implemented a grappling hook in my game: https://twitter.com/qdeanc/status/751310743367086080

    The problem is that aiming it is pretty difficult.

    I need the grappling hook aim to snap to the closest grapplable object; sort of like this: https://www.youtube.com/watch?v=WNjk51a4ABs

    Can anyone help?

    #2
    Aim assist is such a common tool in games. Doesn't anybody know how to accomplish it in UE4?

    Comment


      #3
      My best idea would be to use tracing: https://docs.unrealengine.com/latest...ts/Blueprints/

      And so, you'd make a raycast that hits an invisible sphere that you would put around your grapple-able objects, which would return to your actor the instance of object it hit. From there, you do "Get Transform", then Break Transform and use that object's Location as a target for your grappling hook.

      To specifically track long edges, something can probably be done with splines but I'm no expert.

      As a side note, that grappling hook behavior - doesn't it look a lot like the system used in the Arkham games?
      Last edited by Vakaré; 07-13-2016, 07:39 PM.

      Comment


        #4
        Hmmm... that's a good start, but I need something that works in relation to a crosshair. I need the grapple to target grapplable objects closest to where my character is aiming in screen space.

        I suppose that I could make each grapplable object within a radius of my character shoot a ray at her. If they hit her, then I could store the angle between her aim vector and the vector from each grapplable object in an array and retrieve the object that generates the smallest angle. That would mean that she would always grapple objects closest to where she is aiming, right?

        I think the problem with this system is that the rays will always shoot from the center of each grapplable object. I'll have to place several grapple points on the surface of each grapplable object so that my character can grapple the edges of objects. I wish there was a way to generate grapple points from vertices.
        Last edited by qdeanc; 07-13-2016, 10:07 PM.

        Comment


          #5
          Alright, another idea.

          On top of the cast idea I sent, have the object return the coordinates of a spline that's part of the object, and have a crosshair render over it. I'm not sure how possible it is, but it would be another step forward.

          Comment


            #6
            https://twitter.com/qdeanc/status/754409364299984896

            Here's my aim assist in action. It works just like how I said it would. Now for the crosshair...

            Comment


              #7
              Originally posted by qdeanc View Post
              https://twitter.com/qdeanc/status/754409364299984896

              Here's my aim assist in action. It works just like how I said it would. Now for the crosshair...
              https://www.reddit.com/r/gamedev/com...sist_question/
              Also: good talk: http://www.gdcvault.com/play/1017942...ing-Aim-Assist

              IF you got issues with sorting arrays, you could use some function library like:
              https://github.com/Zarkopafilis/Unre.../master/BluHat

              That's some quite intresting and good looking movement flow you got there. Mind sharing what technique you used to get the grapple going?
              Github - YouTube - Unreal Slackers - KITATUS

              Comment


                #8
                The grappling system is just an add force node. When my character reaches a certain distance away from the grappling point, it adds a force towards the grappling point. This force is multiplied by how far my character has extended past the desired "rope" distance so that the force functions like a spring or bungee cable. It's also multiplied by the angle between her velocity vector and the vector aiming at the grappling point. This keeps my character from bouncing too much by only pulling her towards the grappling point when she's moving away from the grappling point.

                It basically acts as an equal and opposite force that keeps her from moving too far away from the grappling point.

                Thanks for the links!
                Last edited by qdeanc; 07-17-2016, 08:13 PM.

                Comment


                  #9
                  Originally posted by qdeanc View Post
                  The grappling system is just an add force node. When my character reaches a certain distance away from the grappling point, it adds a force towards the grappling point. This force is multiplied by how far my character has extended past the desired "rope" distance so that the force functions like a spring or bungee cable. It's also multiplied by the angle between her velocity vector and the vector aiming at the grappling point. This keeps my character from bouncing too much by only pulling her towards the grappling point when she's moving away from the grappling point.

                  It basically acts as an equal and opposite force that keeps her from moving too far away from the grappling point.

                  Thanks for the links!
                  Telling from your tweet, it looks pretty smooth. I wasn't able to reproduce such good feel with my physics constraint way on my Ratchet and Clank series
                  (https://www.youtube.com/watch?v=XbIsV-Mt9II)
                  Github - YouTube - Unreal Slackers - KITATUS

                  Comment


                    #10
                    The grapple you made looks pretty great from what I'm seeing. Perhaps mine simply looks smoother due to my custom character/animations along with how she rotates to always point towards the grappling point.

                    Comment

                    Working...
                    X