From 526d30c569ecfc55e4bef2c53a77dacb8380aeca Mon Sep 17 00:00:00 2001 From: kerboul Date: Sun, 17 May 2026 16:47:13 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20physique=20boule=20(moins=20de=20drag)=20?= =?UTF-8?q?+=20billboard=20name=20tags=20vers=20cam=C3=A9ra?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - turnDamping 7→1.5, idleDrag 3→0.2 : comportement boule plus naturel - Fix billboard : LookRotation inversé (texte faisant face à la caméra, pas dos) s'applique aux labels local (PlayerController) et remote (RemotePlayerController) Co-Authored-By: Claude Sonnet 4.6 --- game/Assets/PlayerController.cs | 7 +++---- game/Assets/Scripts/Network/RemotePlayerController.cs | 7 ++----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/game/Assets/PlayerController.cs b/game/Assets/PlayerController.cs index 880b34a..28c1389 100644 --- a/game/Assets/PlayerController.cs +++ b/game/Assets/PlayerController.cs @@ -20,9 +20,9 @@ public class PlayerController : MonoBehaviour [Header("Steering Feel")] [Tooltip("Damps velocity perpendicular to input — higher = sharper turns")] - public float turnDamping = 7f; + public float turnDamping = 1.5f; [Tooltip("Horizontal friction when no input is held")] - public float idleDrag = 3f; + public float idleDrag = 0.2f; [Header("Bump Collision")] public float bumpForce = 4f; // Impulse force when bumping a remote player @@ -169,8 +169,7 @@ public class PlayerController : MonoBehaviour var cam = Camera.main; if (cam != null) { - // Billboard locked to Y axis — only rotate around vertical - Vector3 lookDir = _nameLabelObj.transform.position - cam.transform.position; + Vector3 lookDir = cam.transform.position - _nameLabelObj.transform.position; lookDir.y = 0f; if (lookDir.sqrMagnitude > 0.001f) _nameLabelObj.transform.rotation = Quaternion.LookRotation(lookDir); diff --git a/game/Assets/Scripts/Network/RemotePlayerController.cs b/game/Assets/Scripts/Network/RemotePlayerController.cs index 56404b9..3354ec9 100644 --- a/game/Assets/Scripts/Network/RemotePlayerController.cs +++ b/game/Assets/Scripts/Network/RemotePlayerController.cs @@ -241,17 +241,14 @@ public class RemotePlayerController : MonoBehaviour transform.rotation = _currentRotation; } - // Keep name label floating ABOVE the ball (world position, not local) - // Billboard: always face camera, locked to vertical axis if (_nameLabelObj != null) { _nameLabelObj.transform.position = transform.position + Vector3.up * 1.5f; var cam = Camera.main; if (cam != null) { - // Billboard locked to Y axis — only rotate around vertical - Vector3 lookDir = _nameLabelObj.transform.position - cam.transform.position; - lookDir.y = 0f; // Lock to horizontal plane + Vector3 lookDir = cam.transform.position - _nameLabelObj.transform.position; + lookDir.y = 0f; if (lookDir.sqrMagnitude > 0.001f) _nameLabelObj.transform.rotation = Quaternion.LookRotation(lookDir); }