19 lines
480 B
GDScript

class_name ProxyController
extends Controller
@export var interpolation_speed: float = 10.0
var player: Player
var server_position: Vector3
func _init(new_player: Player):
player = new_player
name = "Controller"
func _ready():
server_position = player.position
func _process(delta: float):
var time := interpolation_speed * delta
player.position.x = lerpf(player.position.x, server_position.x, time)
player.position.z = lerpf(player.position.z, server_position.z, time)