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.
asked Dec 07 '17 at 04:56 PM in Blueprint Scripting
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.
Follow this question
Once you sign in you will be able to subscribe for any updates here