1 导入fbx模型
点击左下角的asset,右键选择import new asset,对于fbx文件可以使用3dmax直接对模型进行导出的。如果没有的话,可以找我哦。fbx文件名称最好不要含有中文,我这里的名称为2.fbx。
2 绑定代码
新建代码,代码名称就是你的类名,如果代码名称修改了一定要修改类名,否则会出现编译错误的。
我这里使用的是默认的文件名称: NewBehaviourScript。
public float speed = 3.0f;
public float sensitivityX = 10.0f;
public float sensitivityY = 10.0f;
//上下最大视角(Y视角)
public float minmumY = -60f;
public float maxmunY = 60f;
float rotationY = 0f;
// Start is called before the first frame update
void Start()
{
print("hello world\n");
Rigidbody rigidbody = GetComponen