From 31d71cd32227bf2001a788533fd7f280d35726c4 Mon Sep 17 00:00:00 2001 From: Ninthly <20953908-ninthly@users.noreply.gitlab.com> Date: Sat, 27 Apr 2024 13:32:08 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Measure=20s?= =?UTF-8?q?peed=20ignoring=20vertical=20speed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- interfaces/hud/hud.tscn | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/interfaces/hud/hud.tscn b/interfaces/hud/hud.tscn index 55bda85..d8f14b2 100644 --- a/interfaces/hud/hud.tscn +++ b/interfaces/hud/hud.tscn @@ -39,10 +39,15 @@ func _ready() -> void: # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(_delta : float) -> void: + + var velocity_xz : Vector3 = player.linear_velocity + velocity_xz.y = 0 + text = \"\" text += \"fps: %s\\n\" % str(Engine.get_frames_per_second()) text += \"position: %d, %d, %d\\n\" % [player.position.x, player.position.y, player.position.z] - text += \"speed: %d km/h\\n\" % (player.linear_velocity.length() * 3.6) + text += \"speed: %d km/h\\n\" % (player.linear_velocity.length() * 3.6) + text += \"speed_xz: %d km/h\\n\" % (velocity_xz.length() * 3.6) " [sub_resource type="Shader" id="Shader_gaah5"]