The only objects that have collisions is the yellow part on the boat and the purple part that I’m climbing. I am unsure how I am supposed to stop this. Both parts are just regular parts. There’s no reason why the boat can climb up a vertical wall, but it does and I have tried everything but can’t figure out how to prevent this from happening
function BoatController:UpdateMovement(deltaTime)
local MoveVector = self.ControlModule:GetMoveVector() -- Player controls
script.Inputs.Forward.Value = MoveVector.Z <= -0.1 -- Forward -> -1 Y
script.Inputs.Backward.Value = MoveVector.Z >= 0.1 -- Backward -> 1 Y
script.Inputs.Right.Value = MoveVector.X >= 0.1 -- Right -> 1 X
script.Inputs.Left.Value = MoveVector.X <= -0.1 -- Left -> -1 X
if self.CurrentBoat then
local NewDriveVector = Vector3.new(
0,
0,
math.clamp(script.ForwardAmount.Value * script.SlowdownPercent.Value, -1, 1)
)
local BoatBaseCFrame = self.CurrentBoat.CFrame
local TrueDirectionVector = BoatBaseCFrame:VectorToWorldSpace(NewDriveVector)
local HorizontalVector = TrueDirectionVector * Vector3.new(1, 0, 1)
local Speed = self.BoatMaxSpeed
self.BodyVelocity.Velocity = HorizontalVector * Speed
local Multiplier = math.sign(NewDriveVector.Z)
self.BodyGyro.CFrame *= CFrame.Angles(0, math.rad((self.Turn / 10) * Vector3.new(0, 0, NewDriveVector.Z).Magnitude * Multiplier), 0)
end
end
Give the boat some weight. Yelllow part can have a density if you go under custom physical properties and change density. Not too much or it wont float.
You will have to adjust your velocity for the new weight accordingly.
Setting density to max (100) didn’t result in any changes to how the boat moved Speed didn’t change either.
I can’t change the parts shape or size too, so increasing the parts size is not a viable solution
I’m guessing it’s to do with the reaction forces because of how the rectangle hit box is tilted like so, when the bow of the bolt is tilted upward.
Then there’s also friction between the two that prevents the boat from falling down. Moreover, the body velocity is contributing to this friction by applying a strong force.
Try removing friction so it stops latching on to the wall for both the boat collision, and the wall
local function removeFriction(part : BasePart)
part.CustomPhysicalProperties = PhysicalProperties.new(0.7,0,0.5,9999,1)
end
Another method might be to adjust collision box to adjust the direction of the normal force.
What is your MaxForce on the BodyVelocity? You could prevent the boat from moving up by setting the velocity on the y-axis to 0. This would, however, make it immune to gravitational forces.
A more sophisticated solution would be to apply a downward force based on the vertical velocity of the boat. Said velocity would be clamped to a value greater than or equal to 0 in order to only counteract the upwards movement of the part. If you want to stick to BodyMovers, that could easily be accomplished through the use of the BodyForce object.
Can’t you just disable forces if the boat is out of water? This movement would be pretty realistic if you strapped some kind of a jet engine onto an unbreakable boat.