using System.Collections; using System.Collections.Generic; using UnityEngine; public class script1 : MonoBehaviour { float speed1=15.0f; Rigidbody2D ufo1; // Start is called before the first frame update void Start() { ufo1 = GameObject.Find("UFO").GetComponent(); } // Update is called once per frame void Update() { float x1 = Input.GetAxis("Horizontal"); float y1 = Input.GetAxis("Vertical"); Vector2 movement = new Vector2(x1,y1); ufo1.AddForce(movement * speed1); } }