How do I make a dash that moves in the direction of the player's movement

Started by Disevro on

Topic category: Troubleshooting, bugs, and solutions

Last seen on 22:49, 17. Feb 2024
Joined Jan 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I make a dash that moves in the direction of the player's movement

I'm trying to make a dash that moves the player in the direction they are moving. If a player is moving to the side, they should also dash to the side when they dash.

https://drive.google.com/file/d/1W-TFGXoUHBs-Ki6h9dXAFIYjaYzrIQ8X/view?usp=sharing

Here is what I've come up with so far, this here does not work for some reason.

Last seen on 21:55, 20. Feb 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Link is broken, but here's…
Mon, 01/29/2024 - 23:34

Link is broken, but here's the basic idea for a horizontal dash:

The first option does what you suggested- it multiplies the x and z velocities of the player, launching them based on the direction they're currently moving. (It also overrides their y velocity to be a small upwards boost- since friction with the ground sort of interrupts the dash.)

The second (arguably more helpful, but just my opinion), adds a multiplied look-angle vector to the player's current movement, counteracting or adding to their current momentum based on the direction they're looking. 

With both of these, changing the number you multiply increases the power of the dash. You can also include a y component, but only if you want your players to be able to use this as a jump boost. Also might want to add an upper limit, (using a 'max' function), just because this is going to increase in power exponentially the faster the player is going when they dash.

Last seen on 22:49, 17. Feb 2024
Joined Jan 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you very much, after…
Tue, 01/30/2024 - 00:12

Thank you very much, after toying around with those solutions it seems that I simply set the multiply values too low.