Getting whether the character is moving up or down

Hello! I’m trying to make it so my blueprint can detect whether a character is running UP a ramp or DOWN it. However, this is not the case. Instead, it simply detects if the character is moving up south, or moving up north. Could someone help me? Thank you.

how about getting z velocity or doing a trace then working with the impact normal or get z location then delay get z gain and compare. im sure theres many ways to go about it. more info would be good though, whats the context? whats your aim? 2d or 3d?

moving up south, or moving up north

what is that meant to mean?

Well, it’s 3d. It’s a game 'bout running through loops and up/down slopes, so i need this for momentum. The moving south/north part is how it counts: in one direction its positive, in the other is negative. I meant for it to be the direction you are moving on a z level eg running up a slope affects momentum. Does this help?

My first thought is that what you are really looking for is the acceleration in the Z direction. If the unreal engine documentation is still current, you should be able to use the Get Current Acceleration node and split the output vector to get the Z component. When that component goes positive, your character is going up; when negative, going down. Let me know if that works.

hmmm just tested, z velocity doesnt change due to slopes. the method i used to test was to get velocity from character movement then print z velocity on tick. i then walked up slopes. also tried with jumping which does print velocity as it should.

i think i found another thread with a viable solution.

that should get you started and is a better option than i came up with, see below for a very unoptimized script. haha

260225-test.png

I looked at the example, But don’t know what parts relate to mine, e.g the cut off point of relevancy. Quite new to this. Also, Your script looks pretty alright, but I couldn’t figure out what node the picture is. Could you tell me?
Thanks, and i hope you enjoy your day!

i dont like doing things on tick since it can be expensive that all. as for the node you didnt recognize thats just a vector - vector node but i right clicked the second input and selected split struct pin which breaks the vector into it constituent axis floats.

Yeah, true. But thanks for the response! Not really looking for optimization yet, just anything that works :slight_smile:

Okay, i tried it out and these are the results:

Would I be able to get the rotation compared to the world or something like that?

I just found this tutorial: https://gregmladucky.com/blog/?p=555 . I have no clue if you can utilize it but by the looks of it he has found a way to detect slopes and adjust his values according to them, so you might be able to take some concepts from it and apply them to what you need. Let me know if it helped.

I came across this page before, and it did work. However, with this gravity plugin, it seems to not work possibly due to the way curves work, meaning it would not work on loops and the like. If you need, I could link you the project files so you could see what i’m working with.

Thank you!