I am a beginner, I don’t really know how to code in c#. Can somebody help me making a realistic jump for my game? I tried everything but it just won’t work. I already have a moving script but really want to add a jump:
public class Movement : MonoBehaviour
{
float speed = 10;
public GameObject player;
void Update ()
{
// making vars of getting axis value
float horizontal_movement = Input.GetAxis("Horizontal") * speed * Time.deltaTime;
float vertical_movement = Input.GetAxis("Vertical") * speed * Time.deltaTime;
float jump_movement = Input.GetAxis("Jump");
// moving parts at X and Z Axis
transform.Translate(horizontal_movement, 0, vertical_movement);
player.transform.Translate(horizontal_movement, 0, vertical_movement);
// moving parts at Y Axis
//transform.Translate(0, jump_movement, 0);
//player.transform.Translate(0, jump_movement, 0);
}
}