So I’ve been working on a ball roller game and it works fine till I build it. when I build it the ball rolls at a slower pace than it does in game. How do I get it for them to be the same?
Code source:
public class movement : MonoBehaviour
{
public Rigidbody rigid;
public float horizontal;
public float vertical;
public float speed = 1f;
// Start is called before the first frame update
void Start()
{
rigid = GetComponent<Rigidbody>();
}
// Update is called once per frame
void Update()
{
horizontal = Input.GetAxis("Horizontal");
vertical = Input.GetAxis("Vertical");
Vector3 direction = new Vector3(horizontal, 0.0f, vertical);
rigid.AddForce(direction * speed);
}
}