Added player movement
This commit is contained in:
22
client/player/controller/ProxyController.gd
Normal file
22
client/player/controller/ProxyController.gd
Normal file
@ -0,0 +1,22 @@
|
||||
class_name ProxyController
|
||||
extends Node
|
||||
|
||||
## The character that we're controlling.
|
||||
@export var character: Character
|
||||
|
||||
var server_position: Vector3
|
||||
|
||||
func _ready():
|
||||
server_position = character.position
|
||||
|
||||
func _process(_delta):
|
||||
var move := server_position - character.position
|
||||
move.y = 0.0
|
||||
|
||||
if move.length_squared() < 0.01:
|
||||
# character.position = server_position
|
||||
character.direction = Vector3.ZERO
|
||||
return
|
||||
|
||||
character.direction = Vector3(move.x, 0, move.z)
|
||||
character.direction = character.direction.normalized()
|
Reference in New Issue
Block a user