using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Vikingy : MonoBehaviour {
private Rigidbody2D rb2;
float speed = 2f;
void Start() {
rb = GetComponent<Rigidbody2D>();
}
void Update() {
if (Input.GetKey(KeyCode.W))
rb2.AddForce(Vector2.up * speed);
if (Input.GetKey(KeyCode.A))
rb2.AddForce(Vector2.left * speed);
if (Input.GetKey(KeyCode.D))
rb2.AddForce(Vector2.right * speed);
}
}