- Home /
Question by
EliteHedgehog56 · Jun 30, 2018 at 05:08 AM ·
multiplayergamepadspace shooterflightarcade
single stick arcade flight controls
I am wanting to make a basic splitscreen space combat game, and I am wanting to create a arcade style single stick control scheme similar to star fox 64
I've had a quick google search and couldn't really find what I was looking for
EDIT: well I have made sort of a base for the controls but all I have is pitch and yaw, I want the spaceship to roll slightly when turning left and right on the yaw axis.
var turn = 30;
var movementSpeed = 30;
function FixedUpdate (){
//change to input instead of keycodes
transform.position += transform.forward * Time.deltaTime * movementSpeed;
if (Input.GetKey(KeyCode.S)){
transform.Rotate(Vector3.right * turn * Time.deltaTime);
}
if (Input.GetKey(KeyCode.W)){
transform.Rotate(Vector3.left * turn * Time.deltaTime);
}
if (Input.GetKey(KeyCode.D)){
transform.Rotate(Vector3.up * turn * Time.deltaTime);
}
if (Input.GetKey(KeyCode.A)){
transform.Rotate(Vector3.down * turn * Time.deltaTime);
}
}
Comment