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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 03 Feb 2017 12:22 PM |
heres a very glitchy example, that i made
https://www.roblox.com/games/638851561/Hovercar-Testing |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|