LoginSignup
1
1

More than 5 years have passed since last update.

3D空間を簡易的に移動してみる

Last updated at Posted at 2016-12-30
using System;
using System.Collections;

public class TestControl : MonoBehaviour {




    // Use this for initialization
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        this.transform.position += this.transform.forward;


        if (Input.GetKey(KeyCode.S))
        {
            transform.Rotate(-0.5f, 0, 0);
        }
        if (Input.GetKey(KeyCode.W)) 
        {
            transform.Rotate(0.5f, 0, 0);
        }
        if (Input.GetKey(KeyCode.A))
        {
            transform.Rotate(0, 0, 0.5f);
        }
        if (Input.GetKey(KeyCode.D))
        {
            transform.Rotate(0, 0, -0.5f);
        }

    }
}
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1