diff --git a/Assets/Physics/Bot_LowFriction.physicsMaterial b/Assets/Physics/Bot_LowFriction.physicsMaterial new file mode 100644 index 0000000..8f8abf7 --- /dev/null +++ b/Assets/Physics/Bot_LowFriction.physicsMaterial @@ -0,0 +1,15 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!134 &13400000 +PhysicsMaterial: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Bot_LowFriction + serializedVersion: 2 + m_DynamicFriction: 0.3 + m_StaticFriction: 0.3 + m_Bounciness: 0 + m_FrictionCombine: 2 + m_BounceCombine: 2 diff --git a/Assets/Physics/Bot_LowFriction.physicsMaterial.meta b/Assets/Physics/Bot_LowFriction.physicsMaterial.meta new file mode 100644 index 0000000..3fc2129 --- /dev/null +++ b/Assets/Physics/Bot_LowFriction.physicsMaterial.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6c687d24b6f5fbb4783d28d635f71a29 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/M1_Arena.unity b/Assets/Scenes/M1_Arena.unity index 2983be5..9627236 100644 --- a/Assets/Scenes/M1_Arena.unity +++ b/Assets/Scenes/M1_Arena.unity @@ -1639,12 +1639,18 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: cd21368c9a8b1064d913c375fb607c0b, type: 3} m_Name: m_EditorClassIdentifier: Assembly-CSharp::Jankenbots.Prototype.CameraDirector - avatarOffset: {x: 0, y: 4, z: -6} - robotOffset: {x: 0, y: 8, z: -12} + avatarDistance: 8 + robotDistance: 16 + lookSensitivity: 0.18 + zoomSensitivity: 4 + minDistance: 3 + maxDistance: 80 + minPitch: -8 + maxPitch: 78 + lookHeight: 1.2 orbitRadius: 20 orbitHeight: 9 orbitSpeed: 18 - lookHeight: 1.2 --- !u!1001 &579422633 PrefabInstance: m_ObjectHideFlags: 0 @@ -3441,7 +3447,7 @@ BoxCollider: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 781174154} - m_Material: {fileID: 0} + m_Material: {fileID: 13400000, guid: 6c687d24b6f5fbb4783d28d635f71a29, type: 2} m_IncludeLayers: serializedVersion: 2 m_Bits: 0 @@ -5564,6 +5570,7 @@ MonoBehaviour: chassis: {fileID: 0} cruiseForce: 450 throttleDeadzone: 0.08 + yawAssistTorque: 220 pivotAnchorStrength: 1500 pivotAngularResistance: 400 leanTorque: 500 @@ -5699,6 +5706,7 @@ MonoBehaviour: chassis: {fileID: 0} cruiseForce: 450 throttleDeadzone: 0.08 + yawAssistTorque: 220 pivotAnchorStrength: 1500 pivotAngularResistance: 400 leanTorque: 500 diff --git a/Assets/Scripts/Bot/SeatManager.cs b/Assets/Scripts/Bot/SeatManager.cs index 433ad70..abc1f88 100644 --- a/Assets/Scripts/Bot/SeatManager.cs +++ b/Assets/Scripts/Bot/SeatManager.cs @@ -179,6 +179,20 @@ namespace Jankenbots.Prototype { ReleaseSeatRpc(); } + + // Controls hint under the seat box — context-aware (on foot vs driving). + int ty = y + h + 6, th = 54; + GUI.Box(new Rect(x, ty, w, th), "Controls"); + if (mine.HasValue) + { + GUI.Label(new Rect(x + 10, ty + 20, w - 20, 18), "W throttle · LShift pivot · A/D lean"); + GUI.Label(new Rect(x + 10, ty + 34, w - 20, 18), "Q leave · V camera · turn: differ vs teammate"); + } + else + { + GUI.Label(new Rect(x + 10, ty + 20, w - 20, 18), "WASD move · Mouse look · Scroll zoom"); + GUI.Label(new Rect(x + 10, ty + 34, w - 20, 18), "E claim tread · V camera · Esc free cursor"); + } } static string SeatLabel(ulong pilot) => pilot == NoPilot ? "free" : $"#{pilot}"; diff --git a/Assets/Scripts/Bot/TreadPart.cs b/Assets/Scripts/Bot/TreadPart.cs index 50c6e0d..c852ea9 100644 --- a/Assets/Scripts/Bot/TreadPart.cs +++ b/Assets/Scripts/Bot/TreadPart.cs @@ -63,6 +63,9 @@ namespace Jankenbots.Prototype [Range(0f, 0.5f)] public float throttleDeadzone = 0.08f; + [Tooltip("Extra yaw torque (N·m) at full throttle, REINFORCING the natural differential turn so steering reads clearly even with ground friction. Left/Right push opposite ways, so equal throttle cancels to zero → straight line preserved. Set 0 to rely on pure emergent differential. Flip sign in code if it ever fights the turn.")] + public float yawAssistTorque = 220f; + // ---- (b) LOCK-PIVOT tuning ----------------------------------------------- [Header("(b) Lock-pivot — plant this tread as an anchor")] [Tooltip("How hard the planted tread resists the chassis sliding at its position.")] @@ -192,6 +195,13 @@ namespace Jankenbots.Prototype { Vector3 drive = transform.forward * (_throttle * cruiseForce); chassis.AddForceAtPosition(drive, treadPos, ForceMode.Force); + + // Yaw assist: reinforce the differential turn (Left throttles → nose right, + // Right throttles → nose left). Cancels to zero when both throttle equally, + // so straight-line driving is untouched; the maxAngularVelocity clamp still + // caps total spin so this can't reintroduce an uncontrolled tip. + float yawSign = side == Side.Left ? 1f : -1f; + chassis.AddTorque(chassis.transform.up * (yawSign * _throttle * yawAssistTorque), ForceMode.Force); } // ---- (c) PASSIVE LEAN — anti-tip ballast ---------------------------