mirror of
https://gitlab.com/open-fpsz/open-fpsz.git
synced 2026-01-20 03:54:47 +00:00
🧑💻 Measure speed ignoring vertical speed
This commit is contained in:
parent
a1314dfea4
commit
31d71cd322
|
|
@ -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"]
|
||||
|
|
|
|||
Loading…
Reference in a new issue