RopeConstraint seems to be buggy

  1. What do you want to achieve? Free movement for the trailer.

  2. What is the issue? The trailer seems to be attached to the truck but there is no weld.


    First it shows the bug and then how I manually resolve it by moving it and how I want the truck to work.

  3. What solutions have you tried so far? There is nothing on devforum about trucks, and all I saw didnt resolve the problem. Also I tried to change the length of the rope but still nothing.

This function makes the attachments and connects the rope to them.

	-- veh = trailer
	-- Vehicle = truck
	if Vehicle.Type.Value == "Truck" and veh then
		Weld(veh.Root, Vehicle.Engine)
		Weld(Vehicle.TrailerRoot, Vehicle.Engine)

		local att0 = Instance.new("Attachment")
		local att1 = Instance.new("Attachment")
		att0.Position = Vector3.new(-.5, 0, 0)
		att1.Position = Vector3.new(.5, 0, 0)

		att0.Parent = Vehicle.TrailerRoot
		att1.Parent = veh.Root
		
		Vehicle.TrailerRoot.RopeConstraint.Attachment0 = att0
		Vehicle.TrailerRoot.RopeConstraint.Attachment1 = att1
	end

maybe you could try to use a hinge and make sure u have not welded any parts from the trailer to the truck

Hinges can only be rotated in 1 axe and I need all axes. Also, the models are welded separately.

1 Like

Try to lower the density of the trailer… change it by something substantial.

Also if you want it to rotate on all axis, try out the Ballsocket constraint.

Using ballsocketconstraint gives worst driving and changing density of the trailer doesnt work.

Can i ask why you are scripting the constraint and its attachment rather than just setting it up physically? Its much easier to set it up physically and position them perfectly until it moves as desired… then if need be you can script the proper positions.

have to tried using a motor6d they provide more axis

Can i ask why you are scripting the constraint and its attachment rather than just setting it up physically?

Because I want the player to spawn the truck they want and then the player choose what trailer to attach to his truck, so for testing I did this.

1 Like

You are correct but, I need the trailer to be free, the motor6d doesnt give free movement to the trailer.

Thanks for your help! I found the problem, there was a weld hide on a part welding something from the trailer to something of the truck.