using UnityEngine;

public class Playermovent2 : MonoBehaviour {
    public Rigidbody2D rb2;
    public float xSpeed = 5;
    public float ySpeed = 5;
    Vector2 p2MovementVector;

    // Update is called once per frame
    void Update () {
        p2MovementVector = new Vector2((Input.GetAxisRaw("P2Horizontal")), Input.GetAxisRaw("P2Vertical"));
        
    }

    private void FixedUpdate()
    {
        p2MovementVector = new Vector2(p2MovementVector.x * xSpeed, p2MovementVector.y * ySpeed);
        rb2.AddForce(p2MovementVector);
    }
}
