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);
}
}
}
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
List of users who liked
11