我按照了视频敲代码的,但是小球却一直无法移动,不知道哪里出错了
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Player : MonoBehaviour{
private Rigidbody rd;
public int force = 5;
// Use this for initialization
void Start (){
rd = GetComponent<Rigidbody>();
}
// Update is called once per frame
void Update (){
float h = Input.GetAxis("Horizontal");
float v = Input.GetAxis("Vertical");
rd.AddForce( new Vector3(h,0,v) * force );
}
}