using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Player_Movement : MonoBehaviour
{
public float moveSpeed = 5f;
private Rigidbody2D rigidbody;
private Vector2 movement;
// Start is called before the first frame update
void Start()
{
rigidbody = GetComponent<Rigidbody2D>();
}
// Update is called once per frame
void Update()
{
movement.x = Input.GetAxisRaw("Horizontal");
movement.y = Input.GetAxisRaw("Vertical");
}
void FixedUpdate()
{
rigidbody.MovePosition(rigidbody.position + movement * moveSpeed * Time.fixedDeltaTime);
}
}