Problems with built vehicle

Hello there! I’ve been trying to build and code a swivel chair that you can drive like a car. There’s just one minor problem that makes it not function. I’ll go into detail on this.
Screen Shot 2022-08-06 at 8.57.49 PM
This is my swivel chair model before the game starts. It is composed in multiple parts:

  • The VehicleSeat at the top, welded to
  • The “Swivel”, the half of the rod that sticks up into the seat. It is noncancollideable. It has a motor HingeConstraint with the bottom half, which is called the
  • Base, which is welded to each of the
  • Legs, which have no use except to make the chair look like a swivel chair. They are also noncancollideable.
  • The motors are the invisible parts highlighted. They have a Motor HingeConstraint in them attached to the
  • Wheels, which have a motor HingeConstraint attached to them and the
  • Drivers. The drivers are exact copies of the wheels, except noncancollideable and transparent, and only serve to help turn the wheels.

All the wheels are rotated 0, 0, 0.
All the hinges are Motor because I want them all to be able to go at any angle.

So what’s the problem?

Look back at the swivel chair model. This is before the game starts.
Screen Shot 2022-08-07 at 12.06.58 PM
And after the game starts running.
Screen Shot 2022-08-07 at 12.07.10 PM
Which completely disables it from moving. How would I prevent this from happening? What should I put in place to make sure it stays upright like in the first picture? The code is most likely correct, because although the wheels don’t turn, the swivel part of the chair does. All help would be appreciated.

Here is the code, by the way.
(chair being the model everything is contained in)

local vs = script.Parent.VehicleSeat
local b = chair.WheelBack
local f = chair.WheelFront
local l = chair.WheelLeft
local r = chair.WheelRight
local swivel = chair.Swivel
local base = chair.Base

vs:GetPropertyChangedSignal("Steer"):Connect(function()
base.SwivelConstraint.AngularVelocity = 30 * vs.Steer
b.Motor.WheelConstraint.AngularVelocity = 30 * vs.Steer
f.Motor.WheelConstraint.AngularVelocity = 30 * vs.Steer
r.Motor.WheelConstraint.AngularVelocity = 30 * vs.Steer
l.Motor.WheelConstraint.AngularVelocity = 30 * vs.Steer
end)

vs:GetPropertyChangedSignal("Throttle"):Connect(function()
b.Driver.DriverConstraint.AngularVelocity = 60 * vs.Throttle
l.Driver.DriverConstraint.AngularVelocity = 60 * vs.Throttle
r.Driver.DriverConstraint.AngularVelocity = 60 * vs.Throttle
l.Driver.DriverConstraint.AngularVelocity = 60 * vs.Throttle
end)```

As I see, your Wheels are attached to the Top of the Motors, maybe you’d accidentally attach them in the top? (Third image)

The top of the wheels are attached to the bottom of the motors. The motors attachment is it the bottom surface of the motor, the wheel attachment is at the top surface of the wheels.

I also forgot to mention, when you use attachments for vehicles them will weld to the motor, try to move the wheels and the motors some studs depth.

Try disabling collisions for the lower frame of the swivel chair.

Also, the attachments will try to be in the same position. Move the motor parts to be aligned with the centre of the wheels.

Awesome! That worked. Now I just have to redo my code.

1 Like