# Vertical push doesn't let the object fall down instantly [UNITY]

An object (Wall) is continuously moving forward on the X axis with a simple script:

public float speed = .2f;
void FixedUpdate()
{
transform.Translate(speed, 0, 0);
}


It is pushing an other object (Penguin), which is affected by gravity. It can "jump" too, with a script of:

public void Jump()
{
transform.position = new Vector3(transform.position.x, transform.position.y + 1.15f, transform.position.z);
}


When jumping, over a certain value of speed, like 0.2f, the Penguin is not falling to the ground until it reaches a velocity Vector of around (0.0, -10.0f, 0.0).

Setting the speed to 0.02f makes it instantly fall.

How can I achieve the same result with higher speed value?

I attached the setup of the two object in inspector:

• If you want these objects to interact physically, you should treat the transform component as off-limits and move them purely with rigidbody methods. Jan 17, 2020 at 12:41
• In this case, MovePosition for the wall, and AddForce or velocity for the penguin Jan 17, 2020 at 15:59
• @LouisGarczynski could you add this as an answer so I can accept it? Jan 20, 2020 at 11:03
• @LuisGarczynski could you check this topic too please? gamedev.stackexchange.com/questions/178484/… Jan 20, 2020 at 14:57

To move a rigidbody, there's a few different tools:

If it is not kinematic, use rigidbody.velocity or rigidbody.AddForce. For example

rigidbody.velocity = Vector3.forward * Input.GetAxis("Vertical") * playerSpeed;


If it is kinematic, use MovePosition:

rigidbody.MovePosition(rigidbody.position + Vector3.forward * (Input.GetAxis("Vertical") * playerSpeed * Time.fixedDeltaTime));


If you use a CharacterController, use Move or SimpleMove.

controller.Move(Vector3.forward * (Input.GetAxis("Vertical") * playerSpeed * Time.deltaTime));


Only use rigidbody.position if you want to teleport your rigidbody instead of moving it continuously.

Only use transform.position if you don't have a rigidbody, or want to teleport a character controller.

Rotations follow nearly the exact same rules. Scaling is however more complicated, and should be avoided for rigidbodies.