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 have the game read if height of velocity is positive or negative

ok, so I want the game to read wether my character is moving uphill or downhill and based on that it either adds to or subtracts from the characters speed, thus simulating momentum buildup, I figure the best way to do this is ask if the characters velocity is positive or negative (as long as they're not falling) and set that as a condition on a branch, but I cant figure out how to tell the game to read wether its positive or negative.

the current system I have is based off of this tutorial https://www.youtube.com/watch?v=0XGximd6YlU&t=1233s

the problem with this tutorial is it only has set values for moving up or down at certain angles, where as I want to add or subtract from the movement speed based on that angle. the only thing have changed is the final function.

Product Version: UE older version
more ▼

asked Dec 07 '17 at 04:56 PM in Blueprint Scripting

avatar image

22 2 6 12

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

1 answer: sort voted first

Get the actor's Velocity using Get Velocity. Break the output and use the Z value to determine whether your actor is not falling/jumping (Z will be 0), and then which direction it's moving in (Z will be positive if moving up).

In my screenshot I used an ABS node to turn the Z value into a positive. If it's not equal to the original value, that means it's a negative, and your actor is moving downwards.

TLDR: Use the Z value of Get Velocity. Up is positive. Down is negative.

alt text

getzvelocity.png (225.7 kB)
more ▼

answered Dec 07 '17 at 05:33 PM

avatar image

151 3 14 19

avatar image Indicidian Dec 07 '17 at 05:48 PM

hey, this looks great, except I'm using unreal engine 4.9.2 and... get velocity only has one return value... I'm gonna try to get a newer version, but alot of the newer ones dont work on my computer, do you know which one changed the get velocity box?

avatar image Everynone Dec 07 '17 at 05:58 PM

It never changed. If you cannot split a pin (newer versions can) drag a wire and break vector.

avatar image Indicidian Dec 07 '17 at 06:09 PM

nevermind, you just need to get a break vector box

(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