Hi guys,
I’m having problem making Crunch dash with character blueprint and animation montage. I’m new to ue4 and programming in general, learning everything from youtube and epic video tutorials.
Here is my problem: [link text][1]. Basically if the character is on even terrain it works how I want to, but if I start the animation in uneven terrain he goes way farther than I want him to. Can someone tell me why does this happen? And how do I fix it?
This is the code I’m using for my character blueprint.
I had the same problem. On ground I would dash just fine but any dash that would have my character off the ground would send them much further. In my case this was because the character was being slowed down by the friction force of the ground which was absent when the character was in air.
You could manually set the characters velocity after the dash and disable friction while being dashing but so far I found using a timeline and interpolating the characters position to work better than launching the character.
In this first picture the gravity is set to 0 so my character can dash in air without falling. I also don’t want the character to be moving in the Z direction while dashing so I set its velocity to only include the X and Y. I set a bool called CanMove to false which prevents input from the left analog stick being added to movement. This ensures the direction of the dash cannot be changed when started.
GoForward and GoUp are the names of the Inputs bound to the Left Analogs X and Y Axis. The type of dash changes depending on the analog input similar to Dark Souls. I then used the input values and character Forward Vector/Rotation to get the direction of the dash. The variable DashDistance is used to determine the distance the character should dash. The Debug is to visualize where the character should be after the dash is finished.
After the Debug I stored the point the character will dash to. I then played a dash animation. To move the character to the dash point I used a Timeline, VinterpTo, and SetActorLocation node. The Timeline has a single float track which is used as the InterpSpeed.
Here is a picture of the entire dash. Parts cutoff to the left of the picture where just bools I set true or false according to my needs.