mirror of
https://codeberg.org/ProgramSnail/konkr_game_3d.git
synced 2025-12-06 06:38:47 +00:00
19 lines
649 B
GDScript
19 lines
649 B
GDScript
extends Camera
|
|
|
|
export var speed = 10
|
|
export var zoom_speed = 0.6
|
|
|
|
func _process(delta):
|
|
if Input.is_action_pressed("camera_forward"):
|
|
global_translate(Vector3(-delta * speed, 0, 0))
|
|
if Input.is_action_pressed("camera_backward"):
|
|
global_translate(Vector3(delta * speed, 0, 0))
|
|
if Input.is_action_pressed("camera_left"):
|
|
global_translate(Vector3(0, 0, delta * speed))
|
|
if Input.is_action_pressed("camera_right"):
|
|
global_translate(Vector3(0, 0, -delta * speed))
|
|
if Input.is_action_just_released("zoom_in"):
|
|
translate(Vector3(0, 0, -zoom_speed))
|
|
if Input.is_action_just_released("zoom_out"):
|
|
translate(Vector3(0, 0, zoom_speed))
|
|
pass
|