Using VehicleSeat and PrismaticConstraint to transport items

  1. What do you want to achieve? Driving system with transportation (PrismaticConstraint and VehicleSeat)

  2. What is the issue? I’m trying to make a vehicle that can transport players and objects using PrismaticConstraint, but i don’t know how to correctly script that system. I have a simple script that changes the velocity depending on seat’s throttle value, but when the velocity changes instantly the physics don’t apply correctly on items (Delay, not moving with the platform)

  3. What solutions have you tried so far? I searched through the DevForum, asked on Discord servers (still haven’t gotten a reponse yet), read roblox studio documentation and looked at youtube videos.

Here is the script i have made:

local car = script.Parent
local vehicleSeat = car.VehicleSeat
local moverPart = car.Mover
local constraint = moverPart.PrismaticConstraint

vehicleSeat.Changed:Connect(function(property)
    if property == "Throttle" then
        if vehicleSeat.Throttle == 1 then
            constraint.Velocity = 40
        else
            constraint.Velocity = 0
        end
    end
end)

Please help me and if possible to provide code.
Thanks!

Make sure your forces are high enough to move the prismatic properly.
Also set your Restitution and LinearResponsiveness to fine tune the movement.

I’d actually set it to Servo. Leave the AngularVeocity set at whatever works.
Make the TargetPosition 0 for reverse and whatever the max is for your last stop.
You could also script the TargetPostion for different locations along the travel if you’d like.
When the throttle is on then set the TargetPosition. When the throttle is 0 then make the TargetPosition the CurrentPosition.

Thanks for pointing the Restitution and LinearResponsiveness i didn’t know these were a thing (they really need to add details to their physics and related instances)

Also i don’t know if i can use Servo for ActuatorType since my game is like dead rails and has infinite generation.

Talking about Restitution and LinearResponsiveness, do you know what values should i apply for them?

If the game is infinite then you may run into issues with floating point errors at high distances from 0,0,0.
Yeah, the documentation for many instances is written kind of like a reminder to someone who already knows the information.

As far as the values each case is different. Just experiment with really high and really low numbers. If the values seem better toward one end raise or lower them until you fine tune how they react.