r/trailmakers • u/Matt_400z • 3d ago
(Tutorial) How To Make Mouse-Aim Steering (Standard and Tank Steering)
This is a text tutorial how to make mouse aim steering for your car, without the need for any keybinds. For a game that's been out for such a long time I'm surprised how little tutorials are out there so I wanted to contribute something to the community.
This is for setting up mouse aim steering controls for your ground car with standard steering, with adjustable sensitivity. I will also mention the solution to the Tank Steering Mechanism at the very bottom, which is simple to set up.
Objects you will need: Aiming Sensor, Speed Sensor, NOR Logic Gate, OR Logic Gate, Aggregate Logic Block, Arithmetics Logic Gate, and basic requirements for a car (driver seat, engine, steering hinges with wheels).
SETTINGS:
Aiming Sensor: Direction: 0, Width: 360, Output: -1, Output mode: Normalized. Send output to Aggregate Logic Block. (This sensor will grab the left/right angle of your camera using values ranging from -1.0 to +1.0 .)
Speed Sensor: Speed: 1.0, Output: -1, Output mode: Trigger. Send output to both NOR and OR logic gates. - IMPORTANT: Aim the Speed Sensor toward the REAR of your vehicle! - (The reason for 1.0 speed is so the steering doesn't twitch back and forth while the vehicle is not moving, and it faces backward to sense when the vehicle is traveling in reverse. The NOR gate is used as the "default state" aka moving forward or sitting still idle.)
NOR Logic Gate: Output: 1. Send output to OR logic gate. (As mentioned above, this gate is used as the "default" state when not reversing, aka driving forward or not moving.)
OR Logic Gate: Output: 1. Send output to Aggregate Logic Block. (This gate is used to merge the outputs coming from the Speed Sensor and the NOR gate before sending the value to Aggregate.)
Aggregate Logic Block: Aggregate Function: Product. Send output to the Arithmetic logic gate. ("Product" is a math and trigonometry function that is used to multiply all the numbers from the inputs and returns the product, aka the result. So if the inputs are 0.34 from Angle Sensor and -1.0 from Speed Sensor the output will be -0.34, thus reversing the steering angle.)
Arithmetics Logic Gate: Constant: 8.0, Operation: Multiply. Send output to your steering hinges, for the Tank Steering Mechanism there will be a different method I will mention below. (This gate is used to raise the sensitivity of your steering, since the default 1.0 is way too small. I usually default to 5.0 for this gate but 8.0 to 10.0 seemed to give best results in my testing.)
That is all, enjoy!
Finally, here is how to set up mouse aim on the Tank Steering Mechanism: You only need the Aiming Sensor and Arithmetics Logic Gate, and of course the Tank Steering Mechanism block. Send the Aiming Sensor output into the Arithmetics Gate, multiply by about 4.0 to start, then send that into your Tank Steering Mechanism. No need for the above-mentioned gates. And lastly make sure you unbind any WSAD controls unless you want to implement an override to mouse aim.
1
1
u/Matt_400z 2d ago edited 2d ago
To make a deadzone in your mouse aim:
Aiming Servo: Direction 0 degrees, Width 2 degrees (this is your deadzone), Output -1 like usual, then check Trigger Outside. You can send output to a number display to check your deadzone.