using UnityEngine; public class BallController : MonoBehaviour { public Rigidbody Rb; public float Speed; // Start is called once before the first execution of Update after the MonoBehaviour is created void Start() { } // Update is called once per frame void FixedUpdate() { float x = Input.GetAxis("Horizontal"); float y = Input.GetAxis("Vertical"); Rb.AddTorque(Vector3.right * x * Speed); Rb.AddTorque(Vector3.forward * y * Speed); } }