- Home /
Naturally make velocity 0
I have an object falling at velocity V with mass M. I want to know the force needed to make it's net velocity in the Y direction 0. I know I can just make the velocity 0, but that would be unnatural, and wouldn't allow the object to hit the ground of it does not react fast enough.
I want this information so I can make a hovercraft that constantly stays around a meter off the ground. All the equations I've looked up either need a dt or a dx, and I want this to be instantaneous.
And if this just doesn't work, how else would I keep a hovercraft from touching the ground through a physics simulation?
There is no way to make it instantaneously 0 in a "natural" way, that would require an infinite upwards force.
However, you already have the concept of dt - it is the frame time between two FixedUpdate(). So if you apply a force for only one physics frame, you effectively applied an impulse of force*Time.fixedDeltaTime.
exactly as Woflram says, you need a spring for this sort of thing. that's the usual approach in video games for hovercraft, star wars -style speeders, etc.
the physics question you're asking is irrelevant
the answer is very simply that you use the ConstantForce system and simply make the ConstantForce the same as gravity.
this is indeed precisely how a hovercraft (or "a human standing on a floor") works, by applying an equal and opposite force
that part is trivial
however, when you simulate something like a hovercraft, it's all about simulating the small "bounce around" effects caused by small random movements of the air
Answer by barinelg · Feb 06, 2013 at 10:58 PM
From the sounds of the hovercraft, you're making it perpetually fall, which means that you need some amount of upward force to hold it in place. To me, to keep it 100% stationary vertically you'd need an upward velocity that is equal to the downward velocity. Basically you would take the calculated (or set) downward velocity, and then have that velocity applied upwards to it. For a more hover up-and-down effect, you could decrease and then increase the force by a small amount at set intervals.
The only other way I can think of is an upward force acting on a very heavy object just enough that it can just barely get off the ground, but never enough to keep it up in the air.
Maybe some variation of the above? I'm no physics major, and I'm not 100% familiar with the engine's physics systems, but to me the above makes sense. :)
Well you can't act a velocity on something, the only way to make something move is either to use a force or a torque (an angular force). I do have it giving more force as the vehicle gets closer to the ground, but it either settles down on the ground with not enough force, or continuously bounces higher and higher.
bar, it has nothing to do with velocity. you simply set the constant upwards FORCE the same as gravity, which is a constant downwards force
"I'm no physics major" why answer the question man? :)
@Fattie: $$anonymous$$erely canceling out gravity will not comensate any velocity the object already has, it will just stop it from accelerating any further.
Answer by Wolfram · Feb 06, 2013 at 11:29 PM
Haven't tried it, and my physics classes haven been over way too long by now...but in theory it should be something like this to make the object stop within one frame:
Apply a force of -gravity (to compensate gravity) + mass*(-velocity)/Time.fixedDeltaTime.
An entirely different approach to simulate a hovercraft would probably a spring-like approach, mayeb even with a SpringJoint or something.
Your answer
Follow this Question
Related Questions
SImply yet tricky question about RELATIVE VELOCITIES... 1 Answer
Unity3D: Get Velocity after collision 0 Answers
Accelerate a rigidbody towards max speed 2 Answers
slowing sideways velocity 2 Answers
Rigidbody character controller can't walk on stairs 0 Answers