# Rigidbody physically control problem

**URL:** https://discussions.unity.com/t/rigidbody-physically-control-problem/403016
**Category:** Physics
**Tags:** Scripting
**Created:** [December 3, 2009, 9:24pm UTC](https://discussions.unity.com/t/rigidbody-physically-control-problem/403016 "2009-12-03T21:24:58Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![anon\_50633004](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@anon\_50633004](https://discussions.unity.com/u/anon_50633004)
#### Post date: [December 3, 2009, 9:24pm UTC](https://discussions.unity.com/t/rigidbody-physically-control-problem/403016/1 "2009-12-03T21:24:58Z")

</div>

First of all sorry of my English 😉  
There is a rigidbody on my scene which is solely controlled by physics forces (Acceleration mode). Now I have problem with keeping rigidbody constant height over terrain. I want the object to be e.g. 10 meters above the terrain wherever it is and I am looking for optimal solution of calculating this vertical force (or something?), as setting position ‘by hand’ is unacceptable.

---

<div class="post-metadata">

### Author: ![andeeeee](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@andeeeee](https://discussions.unity.com/u/andeeeee)
#### Post date: [December 4, 2009, 1:55pm UTC](https://discussions.unity.com/t/rigidbody-physically-control-problem/403016/2 "2009-12-04T13:55:32Z")

</div>

There is a project attached to [this thread](http://forum.unity3d.com/viewtopic.php?t=29539) that shows how to float an object a constant height above ground (it’s actually for a camera, but it is easily applied to other objects). Basically, you measure the distance to ground with a raycast and then apply a force to counteract gravity if the object is too low.

---

<div class="post-metadata">

### Author: ![anon\_50633004](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@anon\_50633004](https://discussions.unity.com/u/anon_50633004)
#### Post date: [December 5, 2009, 11:37pm UTC](https://discussions.unity.com/t/rigidbody-physically-control-problem/403016/3 "2009-12-05T23:37:15Z")

</div>

It looks very useful, but I want to get rid of “spring moving”. Object should only change position to desired position as fast as possible (using physical forces) and don’t move anymore. That is my problem.

BTW there is no gravity

---

<div class="post-metadata">

### Author: ![andeeeee](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@andeeeee](https://discussions.unity.com/u/andeeeee)
#### Post date: [December 8, 2009, 2:47pm UTC](https://discussions.unity.com/t/rigidbody-physically-control-problem/403016/4 "2009-12-08T14:47:04Z")

</div>

You can make this happen by tweaking the force and damping values. A large force, appropriately damped will move the object quickly without too much springiness.
