Announcement

Collapse
No announcement yet.

Jump to location - Help needed

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

    Jump to location - Help needed

    Hey guys, I'm Jenna, I'm a hobbyist using Unreal just to see what I can make, and I could use some help with a Blueprint I'm designing!


    My player character is based on the First Person Character that comes with Unreal. Heavily modified by now, but it still has all the Character code. The game is about free-running, slowly building momentum over large distances to clear massive jumps, needle-point platforming, that sort of thing. What I'm trying to build right now is auto-jumping, like in Assassins Creed and so many other games.

    When the Walking off Ledge event fires, my character shoots out a bunch of line traces and finds- if possible- an ideal spot to jump to. This part of the code works very nicely. I tested it by simply teleporting to the resulting vector; it always finds a good place for her to land. Cool.

    What I want to do now is to make her jump to the given vector. As a hammy first attempt, I found a magic jump force number that, when scaled to the players speed, would get her close to the mark, most of the time. I can hop across my test level, and it feels like it's working. But it isn't working perfectly, consistently, or for the right reasons. I can't just apply a force impulse to the player, cross my fingers and hope for the best. I need to do this with precision.

    I need a smart way of getting the player to "jump" precisely to a given vector, taking her current movement speed into account and not losing the sense of momentum. I assume this "jump" might be some sort of a Curve, but I could use a push in the right direction.

    I'm not asking anyone to build this for me, just, if you have an idea how you'd approach this problem, I could really use some advice!

    Thank you much!

    #2
    Have a look at projectile trajectory math, like how a mortar fires.

    https://www.omnicalculator.com/physi...jectile-motion
    My Game Frontier Devblog HERE

    Comment


      #3
      Hey Jenna,

      I've never attempted this but it looks like you are trying to calculate a "projectile path" that looks like a curve from the starting location to the end location. I believe there is a node in Blueprint that helps you visualize this but I couldnt find it by Googling.

      Alternatively, check out this tutorial I found on displaying a projectile path - https://www.youtube.com/watch?v=Fkp50urxShg

      Maybe you can use this calculation to determine the amount of force you need to add to your character?

      Good luck and if you end up figuring this out, please post back your solution

      [WIP] Procedural City Generator | RPG AI
      [MARKETPLACE] Animal Behavior Kit | Space Shooter Template | Procedural Foliage Tool | Procedural Park
      [FREE] Modular Road Tool | Action Platformer Template | Radar BP | Free Birds | Procedural Buildings
      Join our Discord

      Comment


        #4
        Well, I think I solved my problem!

        The first thing I did was to find this page; https://gamedev.stackexchange.com/qu...s-launch-angle and convert that formula into Blueprint. Near the end of that process, I realized that there are nodes for this.

        I wound up using the SuggestProjectileVeloctiyCustomArc node and my auto-jump works perfectly now! Even when the player is going super fast, she either successfully finds a place to jump and launches, or doesn't. She never launches herself toward certain death like before.

        Thank you guys for your help! I'm sure I'll need more sooner or later

        Comment


          #5
          Sorry for the double post, here is pretty much my entire blueprint, in case anyone wants to see how its done or suggest further improvements. https://prnt.sc/il39w8

          Comment

          Working...
          X