Player models: bind pose + procedural animation (no more ragdoll poses); passenger feedback in chat

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-26 22:50:52 +02:00
co-authored by Claude Opus 5.5
parent 6d349399ab
commit d32cdd5693
3 changed files with 119 additions and 81 deletions
+12 -4
View File
@@ -11,7 +11,7 @@ namespace MSCO
/// </summary>
public class Passenger
{
const float EnterRange = 4f; // so nah muss man am Fahrzeug stehen
const float EnterRange = 5f; // so nah muss man am Fahrzeug stehen (Abstand zur Fahrzeugmitte)
const float CenterSeatThreshold = 0.2f;
const float BehindCenterSeat = 0.7f;
const float ExitSideOffset = 1.4f; // beim Aussteigen so weit neben den Sitz
@@ -40,14 +40,22 @@ namespace MSCO
SyncedBody best = null;
RemotePlayer driver = null;
float bestDist = EnterRange * EnterRange;
foreach (SyncedBody b in objects.RemoteDrivenVehicles())
List<SyncedBody> driven = objects.RemoteDrivenVehicles();
float nearest = float.MaxValue;
foreach (SyncedBody b in driven)
{
float d = (b.Rb.worldCenterOfMass - player.position).sqrMagnitude;
nearest = Mathf.Min(nearest, d);
PlayerInfo owner;
if (!players.TryGetValue(b.OwnerId, out owner) || owner.Avatar == null) continue;
float d = (b.Rb.worldCenterOfMass - player.position).sqrMagnitude;
if (d < bestDist) { bestDist = d; best = b; driver = owner.Avatar; }
}
if (best == null) return "No vehicle driven by another player nearby";
if (best == null)
{
// Genau sagen, woran es liegt
if (driven.Count == 0) return "Passenger: nobody is driving a vehicle right now (the driver must sit in the driver's seat)";
return "Passenger: get closer to the car (" + Mathf.Sqrt(nearest).ToString("0") + " m away, max " + EnterRange.ToString("0") + " m)";
}
Transform vt = best.Rb.transform;
Vector3 driverHead = vt.InverseTransformPoint(driver.HeadPosition);