public class Hareket : MonoBehaviour: {
public float speed;
private Vector2 movement = Vector2.zero;
private Rigidbody2D rb;
Start() {
rb = GetComponent<Rigidbody2D>();
}
Update() {
movement = new Vector2(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"));
}
FixedUpdate() {
rb.velocity = movement * speed * Time.fixedDeltaTime;
}
}