■ このスレッドは過去ログ倉庫に格納されています
【ゲームエンジン】Unity初心者質問スレBuild3
- 673 :名前は開発中のものです。:2020/02/24(月) 20:37:54.32 ID:A6C4ojr1.net
- >>671
これで規定通りの動きができた
public class Cube_Move : MonoBehaviour
{
void Update()
{
//左に移動
if (Input.GetKey(KeyCode.LeftArrow))
{
this.transform.Translate(-0.1f, 0.0f, 0.0f);
}
//右に移動
if (Input.GetKey(KeyCode.RightArrow))
{
this.transform.Translate(0.1f, 0.0f, 0.0f);
}
//上に移動
if (Input.GetKey(KeyCode.UpArrow))
{
this.transform.Translate(0.0f, 0.1f, 0.0f);
}
//下に移動
if (Input.GetKey(KeyCode.DownArrow))
{
this.transform.Translate(0.0f, -0.1f, 0.0f);
}
}
}
総レス数 1002
359 KB
新着レスの表示
掲示板に戻る
全部
前100
次100
最新50
read.cgi ver.24052200