Cart moves whenever I apply any force to it

Ok, so I only need one hinge constraint between 2 wheels? And I connect them so that they are welded together and the hinge constraint works as an axis?

2 Likes

Don’t start another thread.
It’s basically the same issue, so keep the thread in one place instead of linking other threads to this one. Please delete the other post so there isn’t any confusion.

To keep a HingeConstraint from turning (brakes) just set the AngularVelocity to zero, and the MotorMaxForce to something like 100,000 for starters.

And yes, like I already said, you just made an axle with the welds between the wheels.

2 Likes

image
image
I made both of the attachments exactly the same
And put the hinge constraint in the other wheel
Now how do I weld the wheels to the cart?
Since the wheels just fall off the cart
image

1 Like

How do I weld the wheels to the car so that the wheels can still rotate?

1 Like

Don’t weld the wheels to the cart.

One attachment is in the cart (Attachment0). It shouldn’t be in the other wheel.
One attachment is in the wheel (Attachment1). You have this as the FrontRight
This lets the wheel spin or drive the cart.
Weld the left wheel to the right wheel so they both spin together.

If you have a common axle it doesn’t matter where the location of the Attachments are along the length of the axle, both wheels will spin and be firmly attached to the cart through the HingeConstraint.

If they still fall apart make sure that in the Properties window the Attachment0 and Attachment1 boxes are actually attached to the correct point. I’ve copied or deleted items and those boxes still reference where the HingeConstraint used to be attached, but those items aren’t actually there anymore and cause confusion.

If you select the HingeConstraint it will highlight both the Parts that are attached through the Constraint with a green box. This lets you know they are connected through the Constraint.

2 Likes

Alright. What weld should I use to weld the two wheels together? Just the normal weld?

1 Like

A ConstraintWeld is the easiest.

2 Likes

Alright. I have this now:

image
I created a hinge constraint between the wheel and the cart, and put the attachments at the same place. Then I added a weld constraint on the other side
What else do I have to do to make this cart working?

2 Likes

I also have this problem for some reason?

image
I have set all of the forces to 0, but this still happens?

2 Likes

Try adding friction to the wheels in the custom properties.

1 Like

Did you set up the hinges correctly? Remember that you have to make one for each wheel, or you can weld the left side to the right side, and the Attachment1 must be at the same location as the Attachment0.

image

1 Like

I believe I’ve done that, I’ve made 1 for a wheel and welded the wheel opposite to it with a weld constraint

1 Like

There might be a couple issues.
The parts of the cart or tracks might have a Velocity in them already. Check the AssemblyLinearVelocity in all the components.
Another problem could be that if you used MeshParts or Unions for the wheels their shape might not be perfectly round because the flange and wheel would make a convex shape. Cylinders or Ball shaped Parts are best for any rotating parts. You can check out this plugin Mesh Optimization Tools - Roblox to see what the actual physcial shape of your meshes/unions are. If you set the CollisionFidelity property to Precise it may work out, but usually there are small wedges/flat areas that don’t work well as wheels.

Most cart systems also use Parts under and between the rails to keep them on the tracks.
Here’s a post I made a train model for a while ago to help out. How to make a basic train - #12 by Scottifly

1 Like

Yes, I fixed it! It turned out the rails had a velocity in them. Also, another problem was that my wheels were a union, and the discs protruded out a little bit, which cut into the rails and glitched the cart. Thank you so much!

3 Likes

I have a new problem: how do I fix this

My character applies force to the cart when I enter it, how can I make it so that the cart will not move? (without anchoring it)

2 Likes

So we see here, its teleporting to the player’s orientation, but if we want the vehicle to not to teleport with the player, were gonna need more mass, because the player’s force is too strong. If its massless, theres going to be less mass and alot of speed but problems like that, but more mass will have less speed but atleast it wont teleport to the player because its not stronger than the cart.

1 Like

I’ve tried adding more mass to the cart, but when I do the cart jitters a lot. Any idea why this will happen

I’ve identified the problem: For some reason the cart turns towards the player’s camera
I have no idea why this happens, is there a property that can be turned off to prevent this?

UPDATE: it was an easy fix, I just made the character massless.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.