The default blue dude in the 3rd person template has an example of that in the animation blueprint event graph. Also if you want to ignore velocity on the Z axis, you can just break the vector and use just the XY like this.