You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Gridmap/Player.gd

20 lines
383 B

extends Node3D
const SPEED = 0.25
func _physics_process(delta):
# Movement
var motion = Vector3()
if Input.is_action_pressed("ui_up"):
motion.z += -1.0
if Input.is_action_pressed("ui_down"):
motion.z += 1.0
if Input.is_action_pressed("ui_left"):
motion.x += -1.0
if Input.is_action_pressed("ui_right"):
motion.x += 1.0
global_transform.origin += motion * SPEED