I have followed the building-carkit tutorial on the roblox developer site:
My end result is on the left in the video below.
Now I am trying to create a lego car that I am able to drive (car in the middle), but I have some issues with the steering. I can move forward and backward, but it moves really weird. I am also not able to turn left or right. The video below will show what I mean.
The image below shows what kind of replacement I use for the wheelmount and the wheel itself.
Check your Union wheels using the Show Decomposition Geometry feature of the File>Settings>Physics menu (or there’s a plugin that makes it easier) to see how the Union is actually shaped. It may have bumps or vertices that cause the rough handling.
Also make sure your axle isn’t welded to the frame and is linked to the steering script in the correct manner. If you have the descendants of your model organized differently than the original model the script may not be able to ‘find’ the axle in the model. This should show up as an error in your Output window.
Also, does your axle have CanCollide on? This might make it rotate strangely because the wheel and axle are trying to push away from each other and ‘bouncing’ your wheels.
I had a look at the model and you’ve completely lost me. I don’t know which of the 10313 parts are supposed to be attached to the other parts.
You have all those Parts CanCollide on, which means they’ll contact the other Base parts.
Your Unioned 6015 wheel is so lumpy that of course it’s going to bounce around. Try this Plugin to see what I mean: https://www.roblox.com/library/414923656/Show-Decomposition-Geometry
You have both the front steering components attached to the same Attachment on the center Base, which means the whole front steering assy. will pivot around that point like a solid axle. This means the wheels will rotate around that point that’s 2 studs away and likely hit the green body angled Part if you ever do get them to rotate. I always try to put my wheel hinges at the inner edge of the wheel, or even inside the wheel so there’s less contact with other Parts while steering.
I think the other thing is the scripting is trying to find the first hinge, and you’ve added other hingeconstraints so it doesn’t realize the one you want as a pivot is the correct one.
@Scottifly Thank you for making the time to help me out with this problem.
I have the same feelings about the 10313 wheelmount. The reason why I did not union my 10313 part is, because of the studs and inlets. They will be gone when I union them together. So I chose for the flat part that connects to the 30303 lego part. That part is closer to the vehicle seat.
The reason I have CanColide on on my 10313 wheelmount is, because the building-carkit also has wheelmounts with CanColide on. I have tried them with CanColide off, but I did not do much.
I have checked the 6015 wheels with the plugin you recommended. The only thing that did not look right is the notch in the image below (maybe I will recreate the union in blender in the future to fix that).
So I checked if the wheels really did bounce when rolling on the ground.
It appears to roll smoothly, but when I accelerate the car then it is going to bounce around.
You also mentioned the Attachments on the center have not their own Attachments. The steering components now have their own Attachment again. I have overlooked that for some reason. I also moved the hinge attachments closer to the wheels.
The last thing you mentioned was that there are multiple hingeconstraints. I have overlooked that the back wheels do not need hingeconstraints, so I removed them, but I have also checked the driverscript and my path should be right, because I pointed it to the front wheels.
I have tried the things you mentioned, but it did not solve my issues. Can you check if I did everything you mentioned as you asked? I have also added a V2 if you want to take a look at what I did. myCar.rbxl (113.7 KB) V2
Nice, not at my computer atm so I can’t have a look, but I’d try making all the parts of the steering/axle assemgbly CanCollide off so they can move through other Parts.
Also looking at your images there are welds between the seat and the 2x2 grey square Parts which would affect them for steering as well. Are those welds created by the model’s scripts or did you add them? The one on the left of the last image also appears to be Inactive (dark grey) as opposed to the one on the right which is active (green). This means that the one on the left side is probably Anchored.
Also even small differences in Unions and Cylinders can create bouncing or jumpiness when you deal with small vehicles. I prefer using Transparent Balls with CanCollide on for my Wheels for high speed vehicles since they are actually round instead of cylinders with a bunch of flat circumferential faces.
In my Track Vehicle and suspension test place I actually use Unions as wheels for my 4x4s because of their roughness since they give a bit more ‘bite’ with the edges of the terrain and don’t just spin on steep surfaces.
Apperently the reason why my weld constraints are grey is, because of the ManualWelds I use.
My ManualWelds where also welding the same parts. That is the reason why I was not able to turn my weld constraints to active. I have read it here Weld constraint inactive by default.
Unfortunately turning the weld constraints to active did not help with better steering. I have updated the V2 with this small fix.
What I meant was what happens when you remove the Welds since they will keep them from turning? The HingeConstraints should be what’s holding the axle assemblies to the rest of the car, not the Welds.
Do you mean removing the weld constraints that connects the seat to the wheelmounts or are you talking about welds that connect the wheelmount to the wheel itself, because I do not understand why weld constraints are an issue with the steering? Also I do not have the wheelmount connected to the wheel with a weld. Could you explain what you mean in more details ?
As I understood the model the wheelmount is the part that is supposed to move so it can steer.
If it’s welded to the seat it won’t rotate around the HingeConstraint.
The HingeConstraint needs to be attached to the solid frame of the car with an Attachment and to the wheelmount with another Attachment. It can be the only way the wheel/axle assembly is connected since any other welds between it and the frame won’t allow it to move at all.
I understand what you mean now. I found out I had the weld constraint on the front instead of the back side. I laughed really hard when I discoverd it lol. Unfortunately I still have an issue with my car while driving it. We are getting closer.
As you can see at the start. The wheel gets into an odd position, but after a few sec it goes to the normal position. When I accelerate the car it still moves weird, but I can finally turn the wheels! Do you know what could cause this weird behavour? I thought it would be gone when rotating should be possible.
For some reason one of the two wheels does not rotate really far until I accelerate the car.
I have also turned CanColide off on the center piece to ensure it has enough space, but it did not help as you can see below, so I will turn it back on. This also happens when CanColide is true.
For some reason my wheel goes off it’s place and moves down. I am really confused now.
In version 3 I rotated the left car to the same direction as the middle and right car, so I do not confused with the weld constraints again. myCar.rbxl (113.8 KB) V3
Looks like the spring settings are different from left to right since the right wheel is still up in the air and the left is way down.
The right spring or PrismaticConstraint should be able to move the right wheel away from the height of the axle assembly.
The left wheel being so far down may also indicate it’s touching the body Parts. Try turning right to see what happens to the wheels then. If the Right wheel drops down then it’s probably hitting the frame.
There is a setting in Studio (same place as the ShowDecompositionGeometry) that says “Show Collisions”. This setting shows a red sphere where moving Parts contact other Parts. Try turning it on so you can see where the wheels are touching other items.
I would like to try the Show Collisions setting to find out if it is indeed hitting the frame, but I am not able to find it. I have tried to search for it in the searchbar, but it did not show up.
When I go into the seat I get sometimes strange behaviour like this even with CanColide on. Sometimes the car turns upside down.
For some reason with CanColide on the car will still jump a bit when I go into the seat. Also trying to turn to the left is very strange. The steering still is not what it should be like the car of the building-carkit-1.
Well… I guess I did not cancolide enough of the part… I guess I have to figure out what to do with this.
Why not leave the axle part(s) where they are and put the HingeConstraint Attachment in the very center of the wheel, so there is the least amount of deflection since the wheel is kind of ball shaped anyway?
Also it would make it so the axles don’t have to move around into the other parts.
I tried putting the HingeConstraint Attachments into the center of the wheel, but it reduces the shart turn, so I have moved it to a more appealing spot. The right green ball are the HingeConstraint Attachments.
I have found invisible corners next to the tire, so I have set these parts to CanColide off as a temporary fix. I think I will negate these parts later.
This video shows the steering right now. It is getting better, but I still have some jumps.
I wanted to start solving my tire, but I wanted to test whether the tire was the problem first by checking if the rim could roll properly, because it is round on the outside. Then this happened.
Is this the reason why the car jumps sometimes or is the wheel really the issue?
I have created a better looking wheel in blender, but it still has some of the notches like before.
Here’s a common mistake. You’ve got the wheel torque set to 100 as a base and 10,000 in the script which is fine, but you’ve got the MotorMaxAngularAcceleration set to infinite. This means the wheel goes instantly from 0 rpm to max rpm and causes your torque issue.
I set it to 100 and it seems better, you can play around with it.
Then I set each wheel’s Friction value to 1.0 to get rid of the sliding. You can set it up to max of 2.
The car moves alot smoother now! I have changed the MotorMaxAngularAcceleration to 100 instead of inf and the AngularVelocity to 1.5.
But I still have an issue when I am getting into the seat. It happens alot actually. The wheel and wheel mount reverses for some reason or the car flips over. I do not know what causes this problem.
New version with these changes implemented. myCar.rbxl (118.0 KB) V5
I have found something really helpful. I found out that the car in the tutorial has better friction, because of a simple setting. Apperently the hub, tire and the wheelmount of the car has CustomPhysicalProperties enabled. I changed the Density and the Friction of the tire to 2 like the car of the building-carkit-1 tutorial.
Wheel
Tire
Wheelmount
Because of this, I replaced AngularVelocity and MotorMaxAngularAcceleration to it’s original values, so I am able to go full speed when I turn.
Khanovich also said this to me:
So I created a cylinder with the same size as the tire of my car and replaced the position value to the tire’s position, so it is in the perfect spot. Then I welded the cylinder to the tire and set CanColide to false on the meshpart. The cylinder is going to be invisible, so it looks like my tire is moving the car instead of the cylinder.
Wheel with visible cylinder.
Wheel with invisible cylinder. You don’t notice anything now!
Look how smooth the steering is now!. I was not able to find the reason why my car goes faster than the car in the tutorial. I have been looking at the vehicle seat torque, CylindricalConstraint, HingeConstraint and the driver script, but it looks the same.
Now I have a few things left to do. The random flip or reversing wheels issue when I am taking a seat and the speed of my car. As you can see the speed greatly reduces on the tutorial car when you idle. My car keeps at the same speed for a long time.
Your speed is dependent on the HingeConstraint’s angular velocity and the tire size. Bigger tires spun at the same rpm will travel further so the vehicle goes faster.
Nice catch on the Physical Properties of the wheel(s).