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.
Let me give you the basic steps to start researching:
- Setup input controls. Here are the docs: https://docs.unrealengine.com/latest/INT/Gameplay/Input/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. - Create inputs for the other buttons you will use. These are action mappings.
- 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.
- 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.
- 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/questions/21142/animgraph-can-enter-transition-with-actionaxis-inp.html
- 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/INT/Engine/Rendering/Materials/MaterialInstances/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.
I found a tutorial at Unreal Engine 4 - Level 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?
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.
I think that I got the blueprint working using the third blueprint from:
My blueprint:
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?
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.
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?
I think I got the blueprints working for knobs and levers.
I wish that pressing the WASD keys don’t move the camera.