generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: What would I use to make a hover car?

Previous Thread :: Next Thread 
Eventive is not online. Eventive
Joined: 28 Jul 2011
Total Posts: 9827
03 Feb 2017 12:13 PM
BodyGyro, BodyPosition, etc?

Want it so when a player sits in the car it starts hovering, and adapts to the terrain like the Hover Car experiment place.
(Not copying, this will be for a game)
Report Abuse
LilMcManiac is not online. LilMcManiac
Joined: 31 Oct 2011
Total Posts: 2812
03 Feb 2017 12:16 PM
Honestly, this wouldn't be incredibly hard.

Simply, ray cast down from the bottom, and thats how you know how high up the car is.
Use that to make it hover.

Make sure, the car is always, lets say 10 studs off the bottom.
Report Abuse
mityguy is not online. mityguy
Joined: 07 Jun 2008
Total Posts: 5483
03 Feb 2017 12:21 PM
Like the guy above said. Cast a ray from the Bottom of your car. Then use Body position the force the object to keep it 10 or so studs above where the ray hits the ground.
Report Abuse
LilMcManiac is not online. LilMcManiac
Joined: 31 Oct 2011
Total Posts: 2812
03 Feb 2017 12:22 PM
heres a very glitchy example, that i made

https://www.roblox.com/games/638851561/Hovercar-Testing
Report Abuse
LilMcManiac is not online. LilMcManiac
Joined: 31 Oct 2011
Total Posts: 2812
03 Feb 2017 12:27 PM
put this into the body of the car, of whatever lil boosters you have under it.

local Rs = game:GetService('RunService')
local oldlength = (script.Parent.Position-workspace.Baseplate.Position).Magnitude
Rs.RenderStepped:connect(function()
local ray = Ray.new(script.Parent.Position, script.Parent.Position+Vector3.new(0,oldlength/2.5,0));
oldlength = (script.Parent.Position-workspace.Baseplate.Position).Magnitude
local part,e = workspace:FindPartOnRay(ray,script.Parent)
script.Parent.BodyPosition.Position = Vector3.new(script.Parent.Position.X,e.Y-5,script.Parent.Position.Z);
end)

That should work fine.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image