Hi, I'm trying to create a vehicle. However, when I launch the game, it's buried in the baseplate. I think that the script is good and that it comes from the physical configuration of the vehicle. I removed “Anchor” everywhere. and the wheels I set “CanCollide” to false I set to “true” only on the “part”.If anyone has any ideas, I'd love to hear from you. Thanks!!
#problem with car
1 messages · Page 1 of 1 (latest)
I set the 4 wheels to “Motor” for their Hinge and to hold the front I set “Servor” for the steering.
Here is the script
local seat = script.Parent
local model = seat.Parent
-- Roues arrière motrices
local backLeft = model.BL.Part:FindFirstChild("HingeBack")
local backRight = model.BR.Part:FindFirstChild("HingeBack")
-- Roues avant directionnelles
local frontLeft = model.FL.Part:FindFirstChild("HingeForward")
local frontRight = model.FR.Part:FindFirstChild("HingeForward")
-- Paramètres moteur
local speed = 80
local steerAngle = 15
-- Configuration des moteurs
for _, hinge in pairs({backLeft, backRight}) do
if hinge then
hinge.ActuatorType = Enum.ActuatorType.Motor
hinge.MotorMaxTorque = math.huge
end
end
-- Mise Ă jour continue Ă chaque frame
game:GetService("RunService").Heartbeat:Connect(function()
local throttle = seat.Throttle
local steer = seat.Steer
-- Mouvement arrière
if backLeft then
backLeft.AngularVelocity = speed * throttle
end
if backRight then
backRight.AngularVelocity = speed * throttle
end
-- Direction avant (visuelle ou réelle selon comment les bras sont connectés)
if frontLeft then
frontLeft.TargetAngle = steerAngle * steer
end
if frontRight then
frontRight.TargetAngle = steerAngle * steer
end
end)
when I start the game the car doesn't move and the wheels are stuck in the ground
say it in french
Ah t’es français magnifique
Grosso modo je n’arrive pas à avancer avec mon véhicule les roulés sont ancrés dans la baseplate
Cependant j’ai bien désactivé CanCollide pour les roues
Et décoché Anchor
well its in the ground cuz the wheels have no collission except the hinges
Aren't we supposed to uncheck "CanCollide" on the wheels?
if u want it to be underground, yes
No, of course not, it's just that I saw a checkmark in some of the tutorials.
** You are now Level 1! **
Tu devrai use les physic service
sinon
pour faire que sa ignore le rest de la voiture
Par Exemple, Tu separes les roux, du vehicule en lui mĂŞme.
puis tu log les physic par Exemple
Roux.(jsppluslenomdelaproprietéXD) = "Roux"
Voiture.PhysicTruck = "Car".
mais tu peux avoir une conduite smooth avec ça ?