Announcement

Collapse
No announcement yet.

[BEGINNER] Sprinting need help

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

    [BEGINNER] Sprinting need help

    Hey, I have been messing in UE4 for the last 3-4 hours and decided to make a movement system from scratch.

    Now I got my sprinting button to work!

    But the problem is that i'm sprinting Left/Right/forward and back.

    I only want to sprint moving forward while i'm holding the W key.

    How would I do this? Im thinking to just link a key with the nodes to my sprint button.


    #2
    There are many ways to do this. You could set a Boolean value to true when spring is held, and false when it is released. When W is is pressed, apply the full input value (1 i presume) if the value is true, and only 0.6 if it is false. For the other movement directions, only apply the 0.6 value, regardless of whether or not sprint is held down.
    Marketplace Assets

    Advanced Mobile Input: Marketplace Page | Support Thread ――― Easy Input Remapping: Marketplace Page | Support Thread
    Multiplayer Blueprint Chat System: Marketplace Page | Support Thread ――― Closing Credits System: Marketplace Page | Support Thread
    Minesweeper Template: Marketplace Page | Support Thread ――― Maze Creator: Marketplace Page | Support Thread

    Comment


      #3
      Originally posted by Jamendxman3 View Post
      There are many ways to do this. You could set a Boolean value to true when spring is held, and false when it is released. When W is is pressed, apply the full input value (1 i presume) if the value is true, and only 0.6 if it is false. For the other movement directions, only apply the 0.6 value, regardless of whether or not sprint is held down.
      I tried doing what you said, I'm not a expert on this. But now my sprint wont work at all lol. what did i do wrong? Do i still need to connect the Max walk speed to the Booleans or just remove them?

      But then I wont have the speed I want.

      Comment


        #4
        Where are you actually moving the character at? If it were me, I would have the max walk speed permanently be the value of the running speed, and then only apply some of that if running is false. I have attached a picture of what I would do for the W key (MoveForward), and then for left, right, back, I would only apply the AxisValue * 0.6, since you can't run those directions.

        Wherever you are actually moving your character, you can check to see if the sprinting value is true, and apply a different value if it is (Like I am doing in the example). Does that make sense? There are better (more complex) ways of doing this, but this should work.

        If you are unfamiliar with Axis mappings, they are kind of like your Sprint input mapping, except the AxisValue variable is set to 1 when the key is pressed, and 0 when it is not.
        Last edited by Jamendxman3; 03-17-2019, 05:46 PM.
        Marketplace Assets

        Advanced Mobile Input: Marketplace Page | Support Thread ――― Easy Input Remapping: Marketplace Page | Support Thread
        Multiplayer Blueprint Chat System: Marketplace Page | Support Thread ――― Closing Credits System: Marketplace Page | Support Thread
        Minesweeper Template: Marketplace Page | Support Thread ――― Maze Creator: Marketplace Page | Support Thread

        Comment

        Working...
        X