- Home /
How to make an object hover(Against gravity)
Hello, I'm trying to make a wipeout mock up, but am finding coding it to be quite difficult. All i want to archive is a floating effect- but when i apply a force over that of gravity(9.82) the ship floats on and on forever. how can i keep the ship level above the ground?
Answer by Justin Warner · Apr 24, 2011 at 04:08 PM
Have 2 scripts, if the thing goes to high go down, if goes to far down, goes up...
This'll give a hover effect, and keep the ship level... If this makes sense?
And you can do a ray from below the ship and gets to where it hits's Y value, and makes that its low, so then it hovers to that spot...
If that makes sense? Lol.
But of a confusing answer xD but yeah I'd quite simply go with cast a ray downward - if you're too low add some force upwards. No two scripts stuff, just push up if you're too low :)
Hahaha, yea... Well, there was two ways, 1 with 2 scripts one like you said =) Lol. I can't explain what goes in my head sometimes =).
I've already tried this, just compared to wipeout it seems... Crude. Wipeout the ships drift almost peacefully over the track, while my ship...well it keeps hitting the ground! <:D
Look at the script SmoothFollow... They use probably the same idea, because if it wasn't smooth follow, it'd look pretty bad.
Your answer
Follow this Question
Related Questions
Firing projectile in curve 1 Answer
Rotational Gravity - Camera and Force problems 1 Answer
Sci Fi Racing Controls and Physics? 0 Answers