Check if Character is moving in Z direction?

Would this work: