2019-04-19 10:27:07 +00:00
|
|
|
extends Spatial
|
|
|
|
|
|
|
|
func _process( delta ):
|
|
|
|
|
|
|
|
if Input.is_action_pressed("move_forward"):
|
|
|
|
$dummy/camera_stand.translate( Vector3( 0.0, 0.0,-10.0*delta ) )
|
|
|
|
if Input.is_action_pressed("move_backward"):
|
|
|
|
$dummy/camera_stand.translate( Vector3( 0.0, 0.0, 10.0*delta ) )
|
|
|
|
if Input.is_action_pressed("move_left"):
|
2019-04-25 20:38:32 +00:00
|
|
|
$dummy/camera_stand.translate( Vector3(-10.0*delta, 0.0, 0.0 ) )
|
2019-04-19 10:27:07 +00:00
|
|
|
if Input.is_action_pressed("move_right"):
|
2019-04-25 20:38:32 +00:00
|
|
|
$dummy/camera_stand.translate( Vector3( 10.0*delta, 0.0, 0.0 ) )
|
|
|
|
|
|
|
|
func _input(event):
|
|
|
|
|
|
|
|
if event.is_action_pressed( "move_look" ):
|
|
|
|
Input.set_mouse_mode( Input.MOUSE_MODE_CAPTURED )
|
|
|
|
elif event.is_action_released( "move_look" ):
|
|
|
|
Input.set_mouse_mode( Input.MOUSE_MODE_VISIBLE )
|
|
|
|
|
|
|
|
if event is InputEventMouseMotion:
|
|
|
|
if Input.is_action_pressed( "move_look" ):
|
|
|
|
$dummy/camera_stand/camera.rotate_x( -event.relative.y * 0.01 )
|
|
|
|
$dummy/camera_stand.rotate_y( -event.relative.x * 0.01 )
|
|
|
|
|