Problem with vehicle seat

With the upcoming removal(or deprecating?) of surface hinges I can’t update my custom VehicleSeat’s torque,motor values while running the game because the wheels are now using attachments with an acceleration value set by a NumberValue that has to be high(like 10k+) with a script, before all of this all my engine’s wheels are Surface hinged and tweaking the original VehicleSeat properties was pretty easy since theres no need to use scripts to do all the controlling and acceleration and by that also you can update it’s Torque and Maxspeed while running the game, now I can’t do that unfortunately.

Any help?

1 Like

Can you send your code? It will be easier for us to find any error.

Ok, please wait as im looking for a train model of mine

--Script last updated: 28/6/2020
-- Define variables
local sp 		= script.speed90.Value
local acc 	= script.acceleration7b.Value
local vehicle	= script.Parent.Parent.Wheels
local seat 		= script.Parent
local A1			= vehicle.A1		-- Wheels
local A2        = vehicle.A2
local A3        = vehicle.A3
local A4        = vehicle.A4
local AA1  	= vehicle.AA1	
local AA2		= vehicle.AA2
local AA3		= vehicle.AA3
local AA4		= vehicle.AA4   -- front right
local B1		    = vehicle.B1		-- back left
local B2		    = vehicle.B2		-- back left
local B3			= vehicle.B3		-- back left
local B4			= vehicle.B4		-- back left
local BB1		= vehicle.BB1	-- back right
local BB2		= vehicle.BB2	-- back right
local BB3		= vehicle.BB3	-- back right 
local BB4		= vehicle.BB4	-- back right
-- set up wheels' motor accerlation
A1.Motor.MotorMaxTorque 		= acc
A2.Motor.MotorMaxTorque 		= acc
A3.Motor.MotorMaxTorque 		= acc
A4.Motor.MotorMaxTorque 		= acc
AA1.Motor.MotorMaxTorque 	= acc
AA2.Motor.MotorMaxTorque 	= acc
AA3.Motor.MotorMaxTorque 	= acc
AA4.Motor.MotorMaxTorque 	= acc
B1.Motor.MotorMaxTorque 		= acc
B2.Motor.MotorMaxTorque 		= acc
B3.Motor.MotorMaxTorque 		= acc
B4.Motor.MotorMaxTorque 		= acc
BB1.Motor.MotorMaxTorque 	= acc
BB2.Motor.MotorMaxTorque 	= acc
BB3.Motor.MotorMaxTorque 	= acc
BB4.Motor.MotorMaxTorque 	= acc
while true do
	-- power the wheels
	v = seat.Throttle * sp -- use the seat's throttle to determine the wheels' action (backward? forward? nothing?)
	A1.Motor.AngularVelocity 	= v
	A2.Motor.AngularVelocity 	= v
	A3.Motor.AngularVelocity 	= v
	A4.Motor.AngularVelocity 	= v
	AA1.Motor.AngularVelocity 	= -v
	AA2.Motor.AngularVelocity 	= -v
	AA3.Motor.AngularVelocity 	= -v
	AA4.Motor.AngularVelocity 	= -v
	B1.Motor.AngularVelocity 	= v
	B2.Motor.AngularVelocity 	= v
	B3.Motor.AngularVelocity 	= v
	B4.Motor.AngularVelocity 	= v
	BB1.Motor.AngularVelocity	= -v -- negative values are the rotation of the wheel because its flipped 
	BB2.Motor.AngularVelocity	= -v
	BB3.Motor.AngularVelocity	= -v
	BB4.Motor.AngularVelocity	= -v
	wait(0.1)
end

The value classname is NumberValue btw

What is happening when you are testing and what is supposed to happen?

I’m trying to change the NumberValue while runnning the game, editing it with script isnt a problem since it will update as i run the game again, the problem is there’s nothing changing when i’m driving the train…

Are you changing it on your Client or on the Server, and is the Script ServerSided?

1 Like

yes it is serverscript and serversided (normal script)

Did you change the properties on the Client?

1 Like

No, from running the server, not playing btw

So the problem is the NumberValue isn’t changing when you are driving the train?

1 Like

The numbervalue did change from the window, but physically nothing is speeding the train even adding 20k+ isnt doing it

Does the output return any error?

1 Like

no output errors, just trying to update it while the game is running is the problem, but changing the values in studio before running and then running it changed the value, the problem is im trying to get it to update while its running
Edit: sorry for the long reply, i had to go outside

Im having a similar problem with the vehicle seat, since I’ve been working on days on my car, but when people test it they can’t drive, I figured out why, and its beacuse they have a blocky body, I need help fixing that, please answer if you can help me, thanks.

1 Like

my problem is updating the values does not physically change the vehicle but i recently learned Values instances have their own .Changed event so this topic is resolved now. if you need help on your situation as of now please DM me, i dont quite really understand what you meant by blocky characters affect vehicles, what i could suggest is when anyone sits on the vehicle seat turn the cancollide property of the Humanoidrootpart to false if that helps

1 Like

I will try that, thanks! I’ve been working on my game for almost a Month and issues come, this is the 1st problem that i’ve had.

1 Like