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 AddImpulse relative to character vector instead of world?

I'm trying to create a dodge function in 3rd person blueprints that pushes the player character in a set X and Y direction and plays an animation.

I'm currently doing this by applying a positive float converted into a vector for forwards, and negative for backwards. decided by a branch that checks if the player's forward vector is greater or less than 0 and then plays the forwards or backwards dodge animation.

However, my problem is that when the player turns around, on the world axis, the animation that gets played changes. I want the direction that the player dodges to be tied to how they're moving (essentially W/Left Stick Up + dodge for forward, S/Down for backwards, as well as UpLeft and DownRight etc.) but I've messed up somewhere and can't work out what nodes I need to use for the AddImpulse impulse vectors to achieve this.

Here's what I have at the moment.

alt text

I'm not using the Launch function since it doesn't feel as quick and plays the landing/airborne animations.

Product Version: UE 4.10
more ▼

asked Apr 19 '16 at 11:38 PM in Blueprint Scripting

avatar image

51 4 2 5

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

1 answer: sort voted first

Hey Jack

Try to get the forward vector of a component inside the actor. That should give you the relative forward vector.

Hope this helps :)

more ▼

answered Apr 20 '16 at 12:55 AM

avatar image

1.8k 65 27 89

avatar image JackAD Apr 20 '16 at 12:28 PM

So if move the character forwards 1 unit, then take the character mesh's forward vector, break that vector, will X be 1 regardless of position in world?

(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