Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How to make a dash function?

We are trying to make a dash function that moves the character in the direction the right thumb-stick is pressed. This function would look similar to the airdodge in Super Smash Bros. Melee.


Product Version: UE 4.12
more ▼

asked Jun 13 '16 at 03:29 PM in Blueprint Scripting

avatar image

1 2 3 3

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

First of all you would have to register the input in the Project Configuration/Inputs

RightAnalogVertical RightAnalogHorizontal

Then at every tick create the right analog vector like this:

 FVector rightAnalogInput = FVector(RightAnalogVertical, RightAnalogHorizontal, 0.0f);
 if(FVector.Size() >= SOME_MAGIC_NUMBER)

And on the Dash function, assuming this is a character.

 //Function Dash.
 this.AddMovementInput(DashInput, MAGIC_NUMBER_SCALE, false); 

Now, if it where me, i would create a MovementComponent to add a Movement mode DASH, but that's not necessary, it's just more modular for me

The idea is that the magic numbers are variables that you can modify, not just hardcode


more ▼

answered Jun 13 '16 at 03:36 PM

avatar image

282 12 21 34

avatar image iArchaea Jul 03 '18 at 02:27 AM

Just a heads up this is under Blueprints :)

avatar image HeavyBullets Jul 03 '18 at 06:03 PM

woopsi, you're right

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

I recommend using add impulse if you are simply trying to boost the character in a direction (with the target being the scene root). Now if you want them to float and not fall, you can change the movement mode to Flying briefly (using set MovementMode) and disabling it afterwards. Another way to do this is to just set the WorldLocation of the character x units to the right/left of where they are and adding some form of animation in the middle to make it seem like fast movement.

more ▼

answered Jul 03 '18 at 02:26 AM

avatar image

33 1 4

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question