Files
streaming_world/godot/main/main.gd
2024-05-20 17:22:19 +03:00

24 lines
707 B
GDScript3

extends Spatial
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
if Input.is_action_pressed("forward"):
$Camera.global_transform.origin += -$Camera.global_transform.basis[2] * delta * 100.0
elif Input.is_action_pressed("backward"):
$Camera.global_transform.origin += $Camera.global_transform.basis[2] * delta * 70.0
if Input.is_action_pressed("left"):
$Camera.rotate_y(5.0 * delta)
elif Input.is_action_pressed("right"):
$Camera.rotate_y(-5.0 * delta)