Fix physique boule (moins de drag) + billboard name tags vers caméra
- 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 <noreply@anthropic.com>
This commit is contained in:
@@ -20,9 +20,9 @@ public class PlayerController : MonoBehaviour
|
|||||||
|
|
||||||
[Header("Steering Feel")]
|
[Header("Steering Feel")]
|
||||||
[Tooltip("Damps velocity perpendicular to input — higher = sharper turns")]
|
[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")]
|
[Tooltip("Horizontal friction when no input is held")]
|
||||||
public float idleDrag = 3f;
|
public float idleDrag = 0.2f;
|
||||||
|
|
||||||
[Header("Bump Collision")]
|
[Header("Bump Collision")]
|
||||||
public float bumpForce = 4f; // Impulse force when bumping a remote player
|
public float bumpForce = 4f; // Impulse force when bumping a remote player
|
||||||
@@ -169,8 +169,7 @@ public class PlayerController : MonoBehaviour
|
|||||||
var cam = Camera.main;
|
var cam = Camera.main;
|
||||||
if (cam != null)
|
if (cam != null)
|
||||||
{
|
{
|
||||||
// Billboard locked to Y axis — only rotate around vertical
|
Vector3 lookDir = cam.transform.position - _nameLabelObj.transform.position;
|
||||||
Vector3 lookDir = _nameLabelObj.transform.position - cam.transform.position;
|
|
||||||
lookDir.y = 0f;
|
lookDir.y = 0f;
|
||||||
if (lookDir.sqrMagnitude > 0.001f)
|
if (lookDir.sqrMagnitude > 0.001f)
|
||||||
_nameLabelObj.transform.rotation = Quaternion.LookRotation(lookDir);
|
_nameLabelObj.transform.rotation = Quaternion.LookRotation(lookDir);
|
||||||
|
|||||||
@@ -241,17 +241,14 @@ public class RemotePlayerController : MonoBehaviour
|
|||||||
transform.rotation = _currentRotation;
|
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)
|
if (_nameLabelObj != null)
|
||||||
{
|
{
|
||||||
_nameLabelObj.transform.position = transform.position + Vector3.up * 1.5f;
|
_nameLabelObj.transform.position = transform.position + Vector3.up * 1.5f;
|
||||||
var cam = Camera.main;
|
var cam = Camera.main;
|
||||||
if (cam != null)
|
if (cam != null)
|
||||||
{
|
{
|
||||||
// Billboard locked to Y axis — only rotate around vertical
|
Vector3 lookDir = cam.transform.position - _nameLabelObj.transform.position;
|
||||||
Vector3 lookDir = _nameLabelObj.transform.position - cam.transform.position;
|
lookDir.y = 0f;
|
||||||
lookDir.y = 0f; // Lock to horizontal plane
|
|
||||||
if (lookDir.sqrMagnitude > 0.001f)
|
if (lookDir.sqrMagnitude > 0.001f)
|
||||||
_nameLabelObj.transform.rotation = Quaternion.LookRotation(lookDir);
|
_nameLabelObj.transform.rotation = Quaternion.LookRotation(lookDir);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user