using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerControler : MonoBehaviour
{
public float Speed;
private Vector2 direction;
private Rigidbody2D rb;
void Start()
{
rb = GetComponent();
}
void Update()
{
direction.x = Input.GetAxisRaw("horizontal");
direction.y = Input.GetAxisRaw("Vertical");
}
void FixedUpdate()
{
rb.MovePosition(rb.position + direction * Speed * Time.fixedDeltaTime);
}
}