Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ void Update()
right -= 1.0f;
}

float up = 0.0f;
if ( Input.GetKey( KeyCode.E ) )
{
up += 1.0f;
}
if ( Input.GetKey( KeyCode.Q ) )
{
up -= 1.0f;
}

float currentSpeed = speed;
if ( Input.GetKey( KeyCode.LeftShift ) || Input.GetKey( KeyCode.RightShift ) )
{
Expand All @@ -61,7 +71,7 @@ void Update()
float deltaRealTime = realTimeNow - realTime;
realTime = realTimeNow;

Vector3 delta = new Vector3( right, 0.0f, forward ) * currentSpeed * deltaRealTime;
Vector3 delta = new Vector3( right, up, forward ) * currentSpeed * deltaRealTime;

transform.position += transform.TransformDirection( delta );

Expand All @@ -87,7 +97,7 @@ void OnGUI()
if ( showInstructions )
{
GUI.Label( new Rect( 10.0f, 10.0f, 600.0f, 400.0f ),
"WASD/Arrow Keys to translate the camera\n" +
"WASD EQ/Arrow Keys to translate the camera\n" +
"Right mouse click to rotate the camera\n" +
"Left mouse click for standard interactions.\n" );
}
Expand Down