Announcement

Collapse
No announcement yet.

Getting vehicle movement axis

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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.
    Unreal Engine 4 C++ Programmer

    My projects:
    Ultimate Arena FPS

    Our Discord Server:
    Ultimate Arena FPS Discord

    #2
    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.
    FREE Lightshow
    FREE VR Drum Kit Project

    FREE Color LUT Collection
    FREE Physics Driven Spacecraft Project
    FREE GTA Style Vehicle Interaction
    Dynamic DoF(Depth of Field)
    Camera Crossfade

    Comment


      #3
      Originally posted by Jacky View Post
      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.
      Unreal Engine 4 C++ Programmer

      My projects:
      Ultimate Arena FPS

      Our Discord Server:
      Ultimate Arena FPS Discord

      Comment


        #4
        This is how I did it for the steering angle:

        Create a publicly visible float variable and set it in the vehicle BP:
        Click image for larger version

Name:	Steer1.PNG
Views:	1
Size:	319.7 KB
ID:	1052524
        Then in the HUD, I added this to print it onto the screen for debugging:
        Click image for larger version

Name:	Steer2.PNG
Views:	1
Size:	176.5 KB
ID:	1052525
        Just hook the cast into the "Event Receive Draw Hud" event.
        Free Community Ocean & Sky Project || Join us on Discord! || Trello Roadmap

        Comment


          #5
          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.
          Click image for larger version

Name:	cast.PNG
Views:	1
Size:	135.0 KB
ID:	1052526
          Free Community Ocean & Sky Project || Join us on Discord! || Trello Roadmap

          Comment


            #6
            Originally posted by DotCam View Post
            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.
            [ATTACH=CONFIG]6533[/ATTACH]
            Thanks! I used the Speed for the Forward Axis.
            I don't use the Input Axis, because the animation is too fast.
            Unreal Engine 4 C++ Programmer

            My projects:
            Ultimate Arena FPS

            Our Discord Server:
            Ultimate Arena FPS Discord

            Comment

            Working...
            X