swordmanwj 发表于 2013-4-12 16:29

坦克一开就翻

本帖最后由 swordmanwj 于 2013-4-15 10:08 编辑

建立一个地形~导入坦克模型控制坦克移动 在地形加一个小坡~坦克一开慢动作飘起来 再慢动作落地~~有时候会飞起来~ 是怎么回事~~

Haohan_Meng@163 发表于 2013-4-12 17:16

坦克的移动使用的什么方式,是力来驱动吗,有没有翻车的截图?

swordmanwj 发表于 2013-4-12 17:54

if (Input.GetKey (KeyCode.LeftArrow))
      {
            transform.Translate(Vector3.right*10);
                        print ("hero go");
      }

      if(Input.GetKey (KeyCode.RightArrow))
      {
            transform.Translate(Vector3.right*-10);
                        print ("hero back");
      }

      if (Input.GetKey (KeyCode.UpArrow))
      {
            transform.Rotate(Vector3.up*Time.deltaTime*160);
                        print ("hero turn left");
      }

      if(Input.GetKey (KeyCode.DownArrow))
      {
            transform.Rotate(Vector3.up*Time.deltaTime*-160);
                        print ("hero turn right");
      }

Haohan_Meng@163 发表于 2013-4-13 09:00

是不是移动的速度太快了,Vector3.right*10 是每帧移动的单位,一般每秒都要刷新几十帧,可以乘上Time.deltaTime转换为每秒的方式试一试。

frms 发表于 2013-4-14 11:19

移动的速度太快了

swordmanwj 发表于 2013-4-15 09:44

坦克开到坡子就往上飘 是怎么回事~~速度改成了 transform.Translate(Vector3.right*Time.deltaTime*60);

zw198324 发表于 2017-3-1 13:32

好帖就是要顶

ljhunity3d455 发表于 2017-3-1 14:05

顶顶多好

ljhunity3d455 发表于 2017-3-1 13:59

真心顶

ljhunity3d455 发表于 2017-3-1 13:59

很好哦
页: [1]
查看完整版本: 坦克一开就翻