A-Chassis Steering

I would like to make a chassis where the steering wheel doesnt automatically return back to its position when the player releases the key to turn the wheels.

how would i achieve this?

1 Like

Is there a setting in the A-Chassis setup to turn this on or off?

I’ve done a similar thing with my own slower moving construction vehicles but I have my own contraints type chassis.
Basically I make the steering HingeConstraint (or Motor6D weld) move more slowly, and if the A or D isn’t being pressed it sets the required angle to the current angle of where the steering is at.

--[[
		___      _______                _     
	   / _ |____/ ___/ /  ___ ____ ___ (_)__ 
	  / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
	 /_/ |_|   \___/_//_/\_,_/___/___/_/___/
 						SecondLogic @ Inspare
]]

local Tune = {}

--[[Misc]]
Tune.LoadDelay		= 0.5		-- Delay before initializing chassis (in seconds)
Tune.AutoStart		= true		-- Set to false if using manual ignition plugin
Tune.AutoFlip		= true		-- Set to false if using manual flip plugin

--[[Wheel Alignment]]
--[Don't physically apply alignment to wheels]
--[Values are in degrees]
Tune.FCamber		= -1
Tune.RCamber		= -1
Tune.FToe			= 0
Tune.RToe			= 0

--[[Weight and CG]]
Tune.Weight			= 6000		-- Total weight (in pounds)
Tune.WeightBSize	= {			-- Size of weight brick (dimmensions in studs ; larger = more stable)
	--[[Width]]		6		,
	--[[Height]]		3.5		,
	--[[Length]]		14		}
Tune.WeightDist		= 100		-- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
Tune.CGHeight		= .8		-- Center of gravity height (studs relative to median of all wheels)
Tune.WBVisible		= false		-- Makes the weight brick visible

--Unsprung Weight
Tune.FWheelDensity	= .1		-- Front Wheel Density
Tune.RWheelDensity	= .1		-- Rear Wheel Density
Tune.FWLgcyDensity	= 1			-- Front Wheel Density [PGS OFF]
Tune.RWLgcyDensity	= 1			-- Rear Wheel Density [PGS OFF]

Tune.AxleSize		= 2			-- Size of structural members (larger = more stable/carry more weight)
Tune.AxleDensity	= .1		-- Density of structural members

--[[Suspension]]
Tune.SusEnabled     = true       -- Enable suspension

-- Front Suspension
Tune.FSusStiffness  = 25000      -- Spring Force (Adjusted for better comfort)
Tune.FSusDamping    = 700        -- Spring Damping (Increased for smoother ride)
Tune.FAntiRoll      = 1000        -- Anti-Roll (Reduced for better stability)

Tune.FSusLength     = 2.5        -- Resting Suspension length (in studs) (Adjusted for bus weight)
Tune.FPreCompress   = 0.2        -- Pre-compression adds resting length force (Lower for softer initial compression)
Tune.FExtensionLim  = 3          -- Max Extension Travel (in studs) (Increased for better road absorption)
Tune.FCompressLim   = 1.5        -- Max Compression Travel (in studs) (Adjusted for bus weight)
Tune.FSusAngle      = 85         -- Suspension Angle (degrees from horizontal) (Slightly lowered for stability)

Tune.FWsBoneLen     = 7          -- Wishbone Length (Extended for better weight distribution)
Tune.FWsBoneAngle   = 5          -- Wishbone angle (degrees from horizontal) (Adjusted for bus weight)
Tune.FAnchorOffset  = {          -- Suspension anchor point offset (relative to center of wheel)
	--[[Lateral]]       0        ,   -- No lateral offset for stability
	--[[Vertical]]     -0.3      ,   -- Positive = upward (Lowered for smoother ride)
	--[[Forward]]       0        }   -- No forward offset for stability

-- Rear Suspension
Tune.RSusStiffness  = 15000      -- Spring Force (Adjusted for better comfort)
Tune.RSusDamping    = 700        -- Spring Damping (Increased for smoother ride)
Tune.RAntiRoll      = 1000        -- Anti-Roll (Reduced for better stability)

Tune.RSusLength     = 2.5        -- Resting Suspension length (in studs) (Adjusted for bus weight)
Tune.RPreCompress   = 0.2        -- Pre-compression adds resting length force (Lower for softer initial compression)
Tune.RExtensionLim  = 3          -- Max Extension Travel (in studs) (Increased for better road absorption)
Tune.RCompressLim   = 1.5        -- Max Compression Travel (in studs) (Adjusted for bus weight)
Tune.RSusAngle      = 85         -- Suspension Angle (degrees from horizontal) (Slightly lowered for stability)

Tune.RWsBoneLen     = 7          -- Wishbone Length (Extended for better weight distribution)
Tune.RWsBoneAngle   = 5          -- Wishbone angle (degrees from horizontal) (Adjusted for bus weight)
Tune.RAnchorOffset  = {          -- Suspension anchor point offset (relative to center of wheel)
	--[[Lateral]]       0        ,   -- No lateral offset for stability
	--[[Vertical]]     -0.3      ,   -- Positive = upward (Lowered for smoother ride)
	--[[Forward]]       0        }   -- No forward offset for stability

--Aesthetics (PGS ONLY)
Tune.SusVisible		= false			-- Spring Visible
Tune.WsBVisible		= false			-- Wishbone Visible
Tune.SusRadius		= .2			-- Suspension Coil Radius
Tune.SusThickness	= .1			-- Suspension Coil Thickness
Tune.SusColor		= "Bronze"		-- Suspension Color [BrickColor]
Tune.SusCoilCount	= 8				-- Suspension Coil Count
Tune.WsColor		= "Black"		-- Wishbone Color [BrickColor]
Tune.WsThickness	= .1			-- Wishbone Rod Thickness

--[[Wheel Stabilizer Gyro]]
Tune.FGyroDamp		= 100		-- Front Wheel Non-Axial Dampening
Tune.RGyroDamp		= 100		-- Rear Wheel Non-Axial Dampening

--[[Steering]]
Tune.SteerInner    = 35      -- Inner wheel steering angle (in degrees)
Tune.SteerOuter    = 35      -- Outer wheel steering angle (in degrees)
Tune.SteerSpeed    = .015     -- Steering increment per tick (in degrees)
Tune.ReturnSpeed   = .02     -- Steering increment per tick (in degrees)
Tune.SteerDecay    = 500     -- Speed of gradient cutoff (in SPS)
Tune.MinSteer      = 5       -- Minimum steering at max steer decay (in percent)
Tune.MSteerExp     = 1       -- Mouse steering exponential degree

--Steer Gyro Tuning
Tune.SteerD			= 1000		-- Steering Dampening
Tune.SteerMaxTorque	= 50000		-- Steering Force
Tune.SteerP			= 100000	-- Steering Aggressiveness

--[[Engine]]
--Torque Curve
Tune.Horsepower		= 400		--	[TORQUE CURVE VISUAL]
Tune.IdleRPM		= 700		--		https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM		= 5000		--		Use sliders to manipulate values
Tune.Redline		= 6700		--		Copy and paste slider values into the respective tune values
Tune.EqPoint		= 5500
Tune.PeakSharpness	= 7.5
Tune.CurveMult		= 0.16

--Incline Compensation
Tune.InclineComp	= 4.2			-- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)

--Misc
Tune.RevAccel		= 150		-- RPM acceleration when clutch is off
Tune.RevDecay		= 75		-- RPM decay when clutch is off
Tune.RevBounce		= 500		-- RPM kickback from redline
Tune.IdleThrottle	= 3			-- Percent throttle at idle
Tune.ClutchTol		= 500		-- Clutch engagement threshold (higher = faster response)

--[[Drivetrain]]	
Tune.Config			= "AWD"		--"FWD" , "RWD" , "AWD"

--Differential Settings	
Tune.FDiffSlipThres	= 50		-- 1 - 100%				(Max threshold of applying full lock determined by deviation from avg speed)
Tune.FDiffLockThres	= 50		-- 0 - 100%				(0 - Bias toward slower wheel, 100 - Bias toward faster wheel)
Tune.RDiffSlipThres	= 50		-- 1 - 100%
Tune.RDiffLockThres	= 50		-- 0 - 100%
Tune.CDiffSlipThres	= 50		-- 1 - 100%				[AWD Only]
Tune.CDiffLockThres	= 50		-- 0 - 100%				[AWD Only]

--Traction Control Settings
Tune.TCSEnabled		= true		-- Implements TCS
Tune.TCSThreshold	= 20		-- Slip speed allowed before TCS starts working (in SPS)
Tune.TCSGradient	= 20		-- Slip speed gradient between 0 to max reduction (in SPS)
Tune.TCSLimit		= 10		-- Minimum amount of torque at max reduction (in percent)

--[[Transmission]]
Tune.TransModes		= {"Auto", "Semi", "Manual"}								--[[
	[Modes]
		"Auto"		: Automatic shifting
		"Semi"		: Clutchless manual shifting, dual clutch transmission
		"Manual"	: Manual shifting with clutch
		
		>Include within brackets
			eg: {"Semi"} or {"Auto", "Manual"}								
		>First mode is default mode													]]

--Automatic Settings
Tune.AutoShiftMode	= "Speed"												--[[
	[Modes]
		"Speed"		: Shifts based on wheel speed
		"RPM"		: Shifts based on RPM											]]	
Tune.AutoUpThresh	= -200		--Automatic upshift point 	(relative to peak RPM, positive = Over-rev)
Tune.AutoDownThresh = 1400		--Automatic downshift point (relative to peak RPM, positive = Under-rev)

--Gear Ratios
Tune.FinalDrive		= 4.06			-- Gearing determines top speed and wheel torque
Tune.Ratios			= {				-- Higher ratio = more torque, Lower ratio = higher top speed
	--[[Reverse]]	3.70		,	-- Copy and paste a ratio to add a gear
	--[[Neutral]]	0			,	-- Ratios can also be deleted
	--[[ 1 ]]		3.53		,	-- Reverse, Neutral, and 1st gear are required
	--[[ 2 ]]		2.04		,
	--[[ 3 ]]		1.38		,
	--[[ 4 ]]		1.03		,
	--[[ 5 ]]		0.81		,
	--[[ 6 ]]		0.64		,
}
Tune.FDMult			= 1.5			-- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)

--[[Brakes]]
Tune.ABSEnabled		= true		-- Implements ABS
Tune.ABSThreshold	= 20		-- Slip speed allowed before ABS starts working (in SPS) 

Tune.FBrakeForce	= 1600		-- Front brake force
Tune.RBrakeForce	= 1100		-- Rear brake force
Tune.PBrakeForce	= 5100		-- Handbrake force

Tune.FLgcyBForce	= 16000		-- Front brake force [PGS OFF]
Tune.RLgcyBForce	= 11000		-- Rear brake force [PGS OFF]
Tune.LgcyPBForce	= 26000		-- Handbrake force [PGS OFF]

--[[[Default Controls]]
--Peripheral Deadzones
Tune.Peripherals = {
	MSteerWidth				= 67		,	-- Mouse steering control width	(0 - 100% of screen width)
	MSteerDZone				= 10		,	-- Mouse steering deadzone (0 - 100%)

	ControlLDZone			= 5			,	-- Controller steering L-deadzone (0 - 100%)
	ControlRDZone			= 5			,	-- Controller steering R-deadzone (0 - 100%)
}

--Control Mapping
Tune.Controls = {

	--Keyboard Controls
	--Mode Toggles
	ToggleTCS				= Enum.KeyCode.T					,
	ToggleABS				= Enum.KeyCode.Y					,
	ToggleTransMode			= Enum.KeyCode.M					,
	ToggleMouseDrive		= Enum.KeyCode.R					,

	--Primary Controls
	Throttle				= Enum.KeyCode.Up					,
	Brake					= Enum.KeyCode.Down					,
	SteerLeft				= Enum.KeyCode.Left					,
	SteerRight				= Enum.KeyCode.Right				,

	--Secondary Controls
	Throttle2				= Enum.KeyCode.W					,
	Brake2					= Enum.KeyCode.S					,
	SteerLeft2				= Enum.KeyCode.A					,
	SteerRight2				= Enum.KeyCode.D					,

	--Manual Transmission
	ShiftUp					= Enum.KeyCode.E					,
	ShiftDown				= Enum.KeyCode.Q					,
	Clutch					= Enum.KeyCode.LeftShift			,

	--Handbrake
	PBrake					= Enum.KeyCode.P					,

	--Mouse Controls
	MouseThrottle			= Enum.UserInputType.MouseButton1	,
	MouseBrake				= Enum.UserInputType.MouseButton2	,
	MouseClutch				= Enum.KeyCode.W					,
	MouseShiftUp			= Enum.KeyCode.E					,
	MouseShiftDown			= Enum.KeyCode.Q					,
	MousePBrake				= Enum.KeyCode.LeftShift			,

	--Controller Mapping
	ContlrThrottle			= Enum.KeyCode.ButtonR2				,
	ContlrBrake				= Enum.KeyCode.ButtonL2				,
	ContlrSteer				= Enum.KeyCode.Thumbstick1			,
	ContlrShiftUp			= Enum.KeyCode.ButtonY				,
	ContlrShiftDown			= Enum.KeyCode.ButtonX				,
	ContlrClutch			= Enum.KeyCode.ButtonR1				,
	ContlrPBrake			= Enum.KeyCode.ButtonL1				,
	ContlrToggleTMode		= Enum.KeyCode.DPadUp				,
	ContlrToggleTCS			= Enum.KeyCode.DPadDown				,
	ContlrToggleABS			= Enum.KeyCode.DPadRight			,
}

--[[Weight Scaling]]
--[Cubic stud : pounds ratio]
--[STANDARDIZED: Don't touch unless needed]
Tune.WeightScaling = 1/50	--Default = 1/50 (1 cubic stud = 50 lbs)
Tune.LegacyScaling = 1/10	--Default = 1/10 (1 cubic stud = 10 lbs) [PGS OFF]

return Tune
1 Like

Try setting
Tune.ReturnSpeed = .02 – Steering increment per tick (in degrees)
to 0.
It looks like this may be the speed the steering returns to 0 after you release the input.

Changing this property stops the vehicle from turning the wheels towards the other side by yourself.

Ah, then you may need to look into the control script to search for the steering section to change where it sets the steering to 0 when A or D is released.

That returns the wheel to its original position

I know.
But I’m sure that that’s the section you need to change it from the 0 position to keep it at the last orientation the wheels were at.
I don’t have that section of code so I can’t have a look at it. The section of code you posted is the tuning script, not the operation script that handles how the player inputs drive the car.

just put returning speed to 0.001