Download

Getting vehicle movement axis

Hi, is there a method to get the current vehicle movement axis? For example how much the vehicle is steering (negative value if it’s steering to the left, while positive value if it’s steering to the right), or if the vehicle is going on a forward gear, or if the vehicle is going on the reverse gear.

You can get the current gear and compare it to the value you like to find out if it is forward or reverse. And you also have access to front wheel angle.

Thanks, but I don’t think that the gear system is a good system for the Animation BlendSpace, because the animation is too fast. Is there a method to see if the car is going forward, or if the car is going backward? But not for example: if the car is going forward, return 1, while if the car is going backward, return -1, because with this method, the animation is played too fast.

This is how I did it for the steering angle:

Create a publicly visible float variable and set it in the vehicle BP:
65e33cc80927e7d6c28c4784c7f5ac60bbdd4ef7.png
Then in the HUD, I added this to print it onto the screen for debugging:
65724b92f21c0ebe798e171837971e26109d0347.png
Just hook the cast into the “Event Receive Draw Hud” event.

When you cast the Pawn as a “wheeled Vehicle” as below, you get access to many of it’s properties, such as gear, speed, etc.
669ef9ffe77702bdba1ede5e6e29a0ab93c1baf3.png

Thanks! I used the Speed for the Forward Axis.
I don’t use the Input Axis, because the animation is too fast.