Hey there!
So, here’s the question everyone wants to know. How do you make a hovercar in Roblox Studio. I have seen many questions about it, and even more showcases. But here’s the one thing I want to know, and hope you can help with.
How do you make a basic hovercar that rotates to the walls and ceilings, like the Innovation hovercars?
I’m not a very advanced scripter, so a basic explanation would be nice, and very helpful. I would appreciate basically a, “How Hovercars Work for Dummies” explanation, if that makes sense. Thanks for any and all help you can give me.
Ok so I am not really good of a scripter, but I am kinda guessing this
When you hit the wal (Make a hit function) I am guessing you could use orientation to tilt it to your desire. Maybe what I am going for (Not gaurenteed to work Ill look into this):
YourHoverCar.Orientation = 0,0,90 -- 90 degrees
Not sure if thats how you change orientation but just change the orientation whenever the part(Hover car) touches the specific part that you want it to (Floor, Walls, Roof)
That won’t work very well. You’d probably want to use BodyMovers to control the car, and a BodyGyro to change the rotation of the car smoothly, and raycast to determine when the car is approaching a wall. If the car will be able to drive on flat walls you’d probably also want to change the camera’s orientation so it looks like you’re driving on the ground and make sure the controls work the same no matter what the car’s orientation is (or the car may go down when you are trying to drive forward). I couldn’t explain the math for the life of me though haha
Hello, I am working in hover motors, here are one example video:
This is part of the code:
self.height = 10
self.factor_height = 0
self.height = height -- distance to the ground that you want
self.mass = mass -- Mass of the model
self.need_force = workspace.Gravity * self.mass / cant -- Cant => the total engine in the model
self.power = 4 * self.height * self.mass / (cant * self.dt ^ 2)
...
-- In each motor
while true do
local vector = Vector3.new(0,0,0)
local hit, pos = workspace.FindPartOnRay(workspace, Ray.new(self.part.Position, (self.part.CFrame * CFrame.Angles(-math.pi / 2, 0, 0)).lookVector * self.height * 2))
if hit then
self.dist = (pos - self.part.Position).magnitude
local factor = self.factor_height / 100
local height = self.height * factor
local power = self.power * factor
if self.dist > 0 and self.dist < height * 2 then
local delta = self.dist - self.olddist
local force = power * (1 - self.dist / (height - delta * 10 * factor))
vector = self.part.CFrame:VectorToObjectSpace(Vector3.new(0, self.need_force, 0)) + Vector3.new(0, force, 0)
end
self.olddist = self.dist
end
self.part.BodyThrust.Force = vector
wait()
end
...