i was trying to apply force to the look vector of my vehicle seat so that the force would be applied to where the boat is facing but the boat just drifts forwards when i turn. i have included a vid at the bottom.
also if anyone has any efficient ways for making the boat stop when the player isnt using the throttle float, i would greatly appreciate it. tysm!
function boat:HandleThrust()
local rs = game:GetService("RunService")
if not self.connection then
self.connection = rs.Stepped:Connect(function(dt)
local velocity = self.vehicleSeat.AssemblyLinearVelocity
local speed = velocity.Magnitude
if self.vehicleSeat.SteerFloat ~= 0 then
self.rotation.Torque = Vector3.new(0, (self.TotalMass * -self.vehicleSeat.SteerFloat) * 15, 0)
print(self.rotation.Torque)
else
self.rotation.Torque = Vector3.zero
end
if self.vehicleSeat.ThrottleFloat ~= 0 then
print(speed)
self.thrust.Force = self.vehicleSeat.CFrame.LookVector.Unit * self.TotalMass * self.vehicleSeat.ThrottleFloat * 5
if speed >= self.config:GetAttribute("MaxSpeed") then
self.drag.Force = Vector3.new((self.vehicleSeat.ThrottleFloat * self.TotalMass) * -5,0,0)
--print({"thrust: ", self.thrust.Force,
-- "drag: ", self.drag.Force
--})
else
self.drag.Force = Vector3.zero
end
else
self.drag.Force = Vector3.zero
self.thrust.Force = Vector3.zero
self.vehicleSeat.AssemblyLinearVelocity = Vector3.zero
end
end)
end
end