Announcement

Collapse
No announcement yet.

How to create car dashboard with working levers, switches, and steering wheel?

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

    How to create car dashboard with working levers, switches, and steering wheel?

    How do I create car dashboard with working levers, switches, and steering wheel using blueprints? I'll be using gamepad to control the levers, switches, and steering wheel. For example, moving the left thumbstick to left should cause the steering wheel to turn to the left and moving the left thumbstick to right should cause the steering wheel to turn to the right. Pressing the "Y" button should cause the automatic transmission lever to move up a notch and pressing the "A" button should cause the automatic transmission lever to move down a notch. Pressing the "X" button should cause the left turn signal to blink and pressing the "X" button should cause the right turn signal to blink. I tried to check the documentation on this website but I couldn't find anything.

    Click image for larger version

Name:	dashboard.PNG
Views:	1
Size:	166.8 KB
ID:	1155608

    #2
    Let me give you the basic steps to start researching:

    1. Setup input controls. Here are the docs: https://docs.unrealengine.com/latest...put/index.html
    you will have an input for the main actions you want performed such as steering left and right. These are called axis mappings.
    2. Create inputs for the other buttons you will use. These are action mappings.
    3. Create a blueprint to control your dashboard. Look for the inputs you've created under axis events and action events in the right click menu. Connect these to the logic graph that you will build.
    4. For the steering wheel there are a few ways you could do it, the easiest way in my opinion would be to drive the rotation of the static mesh directly through blueprint if it is a separate model. You will connect your axis mappings to nodes such as "Add controller yaw input". Look at the default player character in the first person template for an example.
    5. The shifter can be dealt with similarly to the steering wheel, although you would probably want to actually use the animation tools for that one. Simply rig your transmission lever in the package of your choice and then animate it through its different cycles. Import the animations as FBX files and play them when appropriate in the blueprint. More on this here: https://answers.unrealengine.com/que...naxis-inp.html
    6. For the blinkers you need to set up dynamic materials. Create an emmissive material whose emmisive strength is driven by a paramenter and controled through blueprint. More on that here: https://docs.unrealengine.com/latest...ces/index.html under "Material Instance Dynamic"

    If you are just getting started with blueprints I know this can all seem daunting. There's no better way to learn than to start doing it! Besides we can give you better help if you have something in progress to show us.
    Last edited by quality; 07-14-2015, 11:49 PM.
    CTO Villusion Studios
    Grad Student in Interactive Design and Game Development, SCAD
    company site: http://www.villusionstudios.com/

    Comment


      #3
      I found a tutorial at http://unrealtutorials.com/unreal-en...vel-blueprint/ but pressing the "F" key plays the animation once. Nothing happens after pressing the "F" key again. There is nothing connected to "Release" pin of "F" event. Any suggestions?

      Comment


        #4
        Unreal Engine 4.8 is driving me crazy. How in the whole world can I cause a 3D mesh to rotate after pressing a key? I looked through some tutorials on the Internet. In Unity 3D, I can write script files that cause 3D mesh to rotate after pressing a key.

        Here is the script for automatic transmission lever:

        var keypressed : int = -2;
        var rotation : int = -30;
        function Start () {
        keypressed = -2;
        rotation = -30;
        }
        function Update () {
        if (Input.GetKeyDown("q"))
        {
        keypressed = keypressed - 1;
        if (keypressed <= -2)
        keypressed = -2;
        }
        if (Input.GetKeyDown("w"))
        {
        keypressed = keypressed + 1;
        if (keypressed >= 2)
        keypressed = 2;
        }
        if (keypressed == -2)
        rotation = -45;
        if (keypressed == -1)
        rotation = -30;
        if (keypressed == 0)
        rotation = -15;
        if (keypressed == 1)
        rotation = 0;
        if (keypressed == 2)
        rotation = 15;
        transform.eulerAngles = Vector3(0,0,rotation);
        }

        Here is the script for steering wheel:

        function Update () {
        transform.eulerAngles = Vector3(0,0,Input.GetAxis("Horizontal")*180);
        }

        I wish that Unreal Engine 4 has a scripting language.

        Comment


          #5
          I think that I got the blueprint working using the third blueprint from:

          https://answers.unrealengine.com/que...f-a-key-a.html

          My blueprint:
          Click image for larger version

Name:	dashboard03.PNG
Views:	1
Size:	286.3 KB
ID:	1082079

          I can't use the thumbstick because trying to turn the steering while also moves the camera. Is it possible to use the thumbstick to turn the steering wheel without moving the camera?

          Comment


            #6
            You need to set up input controls. See my response above. Right now the inputs are setup to drive the camera by default but you can change them to do whatever you want.
            CTO Villusion Studios
            Grad Student in Interactive Design and Game Development, SCAD
            company site: http://www.villusionstudios.com/

            Comment


              #7
              In a vehicle template, moving the left thumbstick along the X-axis steers the car and the camera doesn't move. Is it possible to lock the camera so that it doesn't move?

              Comment


                #8
                I think I got the blueprints working for knobs and levers.

                Click image for larger version

Name:	dashboard04.PNG
Views:	1
Size:	350.0 KB
ID:	1082218

                I wish that pressing the WASD keys don't move the camera.

                Comment

                Working...
                X