- Home /
Rigidbody - Slowly flies?
For some reason my player slowly goes up in the air like a baloon at about 0.05 per second... If I put the mass any higher than 1 then it slowly goes down by 0.05 per second... So if the player walks down a hill he just glides... no matter what his mass, it could be 5 or 500 it still falls at an incredibly slow rate?

Try not to use gravity as a modifier to your game, it is very unpredictable and is more expensive than just using code to move objects.
And there is a force acting on your player so you need to check what is doing that. Also leads to gravity being unpredictable.
Hard to say but, from that screenshot, your polar bear looks huge. Having strange scales messes up gravity - he might not be falling slowly, but be falling at normal speed but from far away. Can you place a default Unity cube next to him for reference?
I have made him to scale, he is 1 unit, quite small because his just a cub
But just for verification here it is

sorry about that, the depth of the last picture makes it look massive due to the lack of lighting from under and the fact he was mid air when I took it and I was quite close
Answer by furibaito · Dec 27, 2014 at 07:56 AM
You should try to lerp the object velocity to zero and see if that helps. I suggest putting this when the player doesn't input any movement controls
void Update()
{
if (Input.GetAxis ("Horizontal") != 0.0f || Input.GetAxis ("Vertical") != 0.0f)
{
// This is just an example of the player is inputting any movement
}
else
{
// The player is not inputting any movement
rigidbody.velocity = new Vector3.Lerp(rigidbody.velocity, Vector3.zero, Time.deltaTime);
}
}
Also, follow what jmgek suggested, try to disable gravity and use scripted movements. For gravity-like movement in the air you could use rigidbody.AddForce downwards (or lerping velocity)
Answer by Laurent11 · Dec 27, 2014 at 06:06 AM
If you terrain if flat, you can do something like :
function Update ()
{
transform.position.y=groundLevel;
}
groundLevel is the level of the ground.
Hope that will help you.
Your answer