作者ALANLIN78 (LIMX无限大)
看板GameDesign
标题[请益] Unity的疑问
时间Wed Apr 29 23:49:38 2015
大大
我照着这影片的程式打出来一段语言了
Unity3D坦克大战全中文教程第3集@程序脚本 YOUTUBE的
但是我的立方体不会随着按钮旋转移动耶
大概是6分钟多片段的那个程式
我有上网抓一张坦克来放在立方体了 我不是用3DSMAX做的坦克图
我还不会画 影片里是用3DSMAX的图
但是坦克变成立方体每一面都一张坦克的图....
这该怎麽改.. 而且现在也不能跑预览游戏 all compiler errors have to be fixed
before you can enter playmode!
var movespeed=5;
var rotatespeed=20;
function Update () {
if(input.getkey(keycode.W))
{
print("moving W");
this.transform.translate(Vector3.forward*time.deltatime*movespeed);
}
else if(input.getkey(keycode.S))
{
print("moving S");
this.transform.translate(Vector3.forward*time.deltatime*-movespeed);
}
else if(input.getkey(keycode.A))
{
this.transform.rotate(Vector3up.forward*time.deltatime*-rotatespeed);
}
else if(input.getkey(keycode.D))
{
this.transform.rotate(Vector3up.forward*time.deltatime*rotatespeed);
}
}
上面这段是我照着影片上的 自己打上去的 不知道哪边出错 请大大指导一下感恩
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 203.77.48.151
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/GameDesign/M.1430322581.A.27B.html
1F:→ killman: 很多字的大小写看起来都是错的 04/30 00:24
2F:推 BSpowerx: 错误讯息点下去 会告诉你哪一行有错 04/30 00:31
3F:→ dreamnook: compiler error => 请学习除错方式XD 04/30 10:59
4F:推 EasyIsBeauty: 贴个错误讯息才有办法帮忙Y 05/02 04:09
5F:→ ALANLIN78: 字母大小写的地方改过可以预览了 05/02 12:40