#Suspension car won't drive, despite copying all your scripts and property changes...
1 messages · Page 1 of 1 (latest)
Consider the following images:
If you look at the timestamps, the image on the right is screenshotted 1 second after the image on the left. In the video, Suphi's mouse doesn't click on any scripts at all in that window of time—It's as if the script appeared out of thin air. Considering the fact the localscript's name is "Drive", I can't help but feel that if my car isn't driving, it's probably because I never made a Drive script (but then again, like I said, I double-checked the video and didn't see any script created called "Drive)
The LocalScript he shows at 29:50 is the drive controller, he talks about how the input would affect the vehicleseat. The "Drive" script is probably just a reference he was using
...
So then I thought, "Okay, maybe I did something wrong with the scripts I did copy from Suphi", and double-checked my scripts. The serverscript actually works fine for certain—and I placed print statements in the localscript, and they all printed correctly. Here's the code for the localscript:
???
it aint letting me paste the next message
I can't paste either
Do you get any errors or does it simply just not work?
first half of LocalScript:
local character = script.Parent
local connection = nil
--> This connection triggers
character.Humanoid.Seated:Connect(function(active, seatPart)
--> The following 3 lines functions correctly, I tested with print statements earlier
if connection ~= nil then connection:Disconnect() connection = nil end
if not seatPart then return end
if seatPart.Name ~= "VehicleSeat" then return end
--> The following line prints only once (which is how it should be)
print("A")
local constraintBL: CylindricalConstraint = seatPart.Parent.WheelBL.CylindricalConstraint
local constraintBR: CylindricalConstraint = seatPart.Parent.WheelBR.CylindricalConstraint
connection = seatPart.Changed:Connect(function(property)
--print("B")
if property == "SteerFloat" then
--> Prints whenever I press A or W
print("X")
```
Second half:
elseif property == "ThrottleFloat" then
local torque = math.abs(seatPart.ThrottleFloat) * seatPart.Torque
print("seatPart.Torque is", seatPart.Torque) --> Prints 5000 or 0 depending on ThrottleFloat value
print("seatPart.ThrottleFloat is", seatPart.ThrottleFloat)
if torque == 0 then torque = 2000 end
--> This does indeed set the MotorMaxTorque, I playtested and confirmed
constraintBL.MotorMaxTorque = torque
constraintBR.MotorMaxTorque = torque
--> angularVelocity either prints as 10000 or 0
local angularVelocity = math.sign(seatPart.ThrottleFloat) * 10000
print("math.sign(seatPart.ThrottleFloat) * 10000 is", angularVelocity)
--> Can confirm constraintBL and constraintBR have AngularVelocity set correctly
--> These always print 5000 or 0
constraintBL.AngularVelocity = angularVelocity
constraintBR.AngularVelocity = angularVelocity
print("angularVelocityBL is", constraintBL.AngularVelocity)
print("angularVelocityBR is", constraintBR.AngularVelocity)
end
end)
end)```
not sure
Anyway, tested everything with printing and looked in the properties window, everything was set correctly
the car just didn't move
and then I thought "Okay, is something wrong with my car model?"
This is what happens:
(I hold W and then let go of W)
The car just refuses to move
The car suspension works, and nothing is anchored
Also, when I hold W, the car wheels don't spin either
so it's not like something is holding the car in place, right?
I can send a copy of the place file if anyone would like
sure i can test it
@onyx knot
The code is correct
So it means you messed something up with the attachments & constraints when setting them
@untold spade https://gyazo.com/c049b3b52f3fe04385c4f087df19d48d
your wheels are backwards
each side is spinning a different direction
even if that's true, the car should still move
I'm using the BL wheel and the BR wheel. If the BL wheel is spinning forward and the BR wheel is spinning backwards, the car should start driving to the right, correct @onyx knot ?
ok so
the back wheels do spin when you hold W or S
obviously opposite directions
but i'm doing this with the car anchored in the air
and network ownership can't be called on anchored parts
so i'm trying to figure out if it's the network ownership or something with the car being on the ground that stops the wheels from spinning
@untold spade alr so it's something to do with when the car is on the ground the wheels can't spin, everything else works fine
yep, just my luck
and this was my second attempt because my first one the springs didn't work
sometimes i hate developing 💀
@untold spade lmao fixed it
and because the wheels are backwards the controls are backwards
S goes forward
your spring min length was too low
what does the spring min length have to do with anything
let me guess
wait
tell me
keeps the hull of the car off the wheels
yeah that's such a stupid mistake
the car was basically sitting on the wheels
can you send the fixed game file?
i mean i could probably fix it on my own but you have it just there
it's fine if you don't want to
that's it?
you didn't change the wheels?
oh
okay i'll go do that
what did you put the minlength to @onyx knot
k
it doesn't really matter how the wheels look
they're gonna be invisible anyway
i'm not plannign for it to be a car
it's supposed to look like a hovering vehicle
hold on
i forgot what i did now it's not working again lmao
ok it's fine
it's still kinda glitchy but that's one problem solved
was it glitchy like this? @onyx knot
pretty much
it might just be springconstraints
that are glitchy
Hey @random onyx are you willing to release a copy of the game file you used for your car suspension tutorial?
#1017080984539234366 message
your problem most likely is not the scripts did you setup the collision groups correctly?