using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SimpleMovement : MonoBehaviour
{
public float speed;
public float jump;
private Rigidbody2D rb;
private float Move;
// Start is called before the first frame update
void Start()
{
rb = GetComponent<Rigidbody2D>();
}
// Update is called once per frame
void Update()
{
Move = Input.GetAxis("Horizontal");
rb.velocity = new Vector2(Move * speed, rb.velocity.y);
if (Input.GetButtonDown("Jump"))
{
rb.AddForce(new Vector2(rb.velocity.x, jump));
}
}
}