I’m using the 3rd person shooter of unity. But the player has no weight. if i’m on a roof and i want to jump down on the ground (or let him fall on the ground). The player don’t fall normally. Maybe it needs weight? :S
Someone can help me how to fix that?
The PlayerController component does not use the physics engine in Unity- you will need to hard-code it yourself with something like
if(not grounded)
Move Downwards
The lack of physics (as well as other limitations) is why I always prefer to use rigidbodies for my characters where this kind of thing is important.
For starters, anyway, try adding a rigidbody component to your character. By default, there is gravity, and rigidbodies must always have positive, non-zero mass, so your character should be falling straight away.
As far as I know, this will work on any game object it is attached to. It adds a constant downward force on the world z axis. You could use this on multiple objects to give different gravity for each. This would be good if you were in space, on a metal platform w/ magnetic boots That way, you would stay grounded, and other object w/ lesser gravity would float around. Hope this helps a bit
var player_gravity : float;
function Start()
{
gameObject.AddComponent(“ConstantForce”);
constantForce.force = new Vector3 (0, 0, -player_gravity);
}