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"

Set actor location relative to direction character is facing

I am trying to make my character move forwards in a double jump type of motion. I'm using a timescale to make it smooth, basically a second degree function along the X axis. However, it uses the world x axis instead of my characters x axis (or direction chracter faces).

I'm sure this is quite an easy fix, any pointers? Here's the blueprint I have right now:

alt text

I have also tried using launch character but it ends up with the same result. I guess that is because of my timescale which only moves the character on one axis. Wondering if it is possible to make that axis local instead of world?

Product Version: UE 4.21
actorlocation.png (130.5 kB)
more ▼

asked Jan 07 '19 at 10:41 PM in Blueprint Scripting

avatar image

Crowley Caine
693 8 10 16

avatar image Crowley Caine Jan 07 '19 at 10:55 PM

Also tried doing it via adding a float value to the X axis, like so:

alt text

But it also ends up sending it along the world X axis of course, instead of the direction of my character.

actorlocation2.png (130.0 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Since you want it to move along its forward direction, multiply the ActorForwardVector by the float value "Add Value" from your timeline, then add it to ActorLocation.

The vector multiplication you were doing, the Cross Product, gives you the vector perpendicular to the plane described by the two vectors, you don't need it.

more ▼

answered Jan 07 '19 at 11:49 PM

avatar image

67 4 6 12

avatar image Crowley Caine Jan 07 '19 at 11:55 PM

Works perfectly, thank you.

Including the image in case anyone else is looking for this. alt text

actorlocation2.png (99.4 kB)
avatar image Crowley Caine Jan 29 '19 at 10:38 PM

Slight update to this, the timelines work perfectly now and I've been able to finish off my combat system with forward movement on certain attacks, thanks again.

Now I'm trying to do the same thing, except move the character in the Z vector (upwards) using get character up vector and getting some really strange results. Either it does nothing, or when it gets to a certain value (between 45 and 50) the character just goes flying.

Any ideas?

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

you should be able to take the output of your timeline then multiply it by the actors forward vector (the node name is something like get actor forward vector) then add the result to the characters current position. also you shouldnt need the interp that you have since your using a timeline and presumably a curve in the timeline.

more ▼

answered Jan 07 '19 at 10:56 PM

avatar image

10.1k 33 10 25

avatar image Crowley Caine Jan 07 '19 at 11:26 PM

Tried that but didn't get any good results. Something like the first picture? alt text

Also tried as seen in the second picture. alt text

Both of them seem to want my character to go to the middle of the map.I was using vinterp because it gave the best results in terms of the actual movement of the character, but again only along the world X.

Here's my timelines: alt text

They are set to arbitrary values now but with vinterp I could simply add the distance I wanted. The reason they look like that is because the character lifts his right foot and steps forward, then there's a short time where both feet are planted and then the left foot is lifted and moves forward to his idle position.

(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