mirror of
https://codeberg.org/ProgramSnail/konkr_game_3d.git
synced 2025-12-06 22:58:44 +00:00
20 lines
649 B
GDScript3
20 lines
649 B
GDScript3
|
|
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
|