I’m currently working on my original vehicle system and I am unable to get the vehicle to stop completely using LinerVelocity.
Especially when I try to stop in the middle of a hill, the vehicle starts moving on its own due to gravity.
Previously, with BodyVelocity, the parts were able to keep stopping in place without being affected by gravity, but this is not possible with LinerVelocity.
How can I make a brake that can stop properly on a slope?
Try removing the linear velocity ? Or maybe simply anchor one of the vehicle’s part
If you remove LinearVelocity, you will not be able to control the vehicle at all, which is something you do not want to do.
Also, if you anchor the vehicle, the vehicle will now be blown far away when you release the anchor.
BodyVelocity could smoothly reduce the speed to zero and stay there, even on a steep slope.
What I meant is that you repove the linear velocity when you want to stop, and when you want to move again you’ll put it back inside the vehicle
Do you mean to set Velocity to 0?
Even if I set it to 0, when I stop on a hill, it starts moving in the downhill direction.
So now you can stop, you just need to fix the gravity problem.
For that try anchoring not the hole vehicle but just one part or the weels and then unanchor them when you want to move
I have tried something similar before, for example, braking uphill and anchoring the parts the moment the actual speed reaches zero. Then the vehicle stops, but this time the parts start to move out of line with each other the moment the anchor is released.
When you release the anchor, you must take measures so that the vehicle does not start moving immediately after the anchor is released.
Did you anchor the body of the car, the part that has all the welds?
All vehicle bodies are welded using welding scripts.
However, tires are not welded because hinge constraints are used.
If only the body is anchored in this condition, the tires will go wild, and if only the tires are anchored, the body will blow off the moment the anchor is released.
i think you can set the linearvelocity’s maxForce to math.huge when the car stops ( when linearVelocity.VectorVelocity becomes 0,0,0 )
if prop == "VectorVelocity" and car.LinearVelocity.VectorVelocity == Vector3.zero then
car.LinearVelocity.MaxForce = math.huge
( “car” is the parent of linearVelocity you are talking about)
and this script will make the car basically not get affected by gravity and just stay still.
Thank you very much, I will give this a try.
(As a side note, I have been using inf.)
Wait, If you used inf for maxForce until now, how did the car even fall by the gravity? linearVelocity keeps the object in place when the maxForce is inf even if the object is unanchored.
I don’t know the cause either. Perhaps something was wrong, but I was wondering because no matter how much power I gave it I could not keep it from stopping on a hill.
It was exactly as you described.
I must have done something wrong with the settings.
Now the part continues to restrain in the air!
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.