🧑‍💻 Measure speed ignoring vertical speed

This commit is contained in:
Ninthly 2024-04-27 13:32:08 +00:00 committed by anyreso
parent a1314dfea4
commit 31d71cd322

View file

@ -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"]