Base fixes: climb over the railing, hay on the deck, no yard logs, console back, logo T
- Climbing up from the meadow rises straight up the side until the feet clear the railing, goes over it and drops onto the deck, instead of an arc through the fence. - Props stand their lowest point on the floor (the hay bale was half under the deck). - The timber bay lines on the unloading yard are gone. - SM_Terminal: the chalkboard's back stands proud of the frame bars, no more flickering where their back faces shared a plane. - Logo: the scythe standing in for the first T of CUTTERS is now a plain T (Tools/ui/logo_t.py copies the second T); menu logo, Steam capsules and the demo's capsules rebuilt from it. - -demofix: close shots of those spots. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@ -118,6 +118,9 @@ namespace GrassCutter
|
||||
bool _swimming;
|
||||
float _climbT = -1f;
|
||||
Vector3 _climbFrom, _climbTo;
|
||||
/// <summary>Climbing up onto the deck goes over its railing (1.05 m), not through it.</summary>
|
||||
bool _climbOver;
|
||||
const float RailClear = 1.2f;
|
||||
float _jumpTapAt = -9f, _dashAt = -9f;
|
||||
Vehicle _vehicle;
|
||||
/// <summary>The train whose cab this player rides in, and the lever as last sent.</summary>
|
||||
@ -538,8 +541,9 @@ namespace GrassCutter
|
||||
if (!Physics.Raycast(from, -up, out var hit, 2.4f, (1 << Layers.Default) | (1 << Layers.Build) | (1 << Layers.Vehicle), QueryTriggerInteraction.Ignore)
|
||||
|| Vector3.Dot(hit.normal, up) < 0.6f || Vector3.Dot(hit.point - transform.position, up) < 0.55f) return false;
|
||||
_climbFrom = transform.position;
|
||||
_climbTo = hit.point + up * 0.05f + fwd * 0.25f;
|
||||
_climbTo = hit.point + up * 0.05f + fwd * 0.45f;
|
||||
_climbT = 0f;
|
||||
_climbOver = true;
|
||||
Body.enabled = false;
|
||||
Sfx.Play("splash_small", 0.5f, 1.3f);
|
||||
Sfx.Play("jump", 0.5f, 0.85f);
|
||||
@ -562,6 +566,7 @@ namespace GrassCutter
|
||||
_climbFrom = transform.position;
|
||||
_climbTo = to + up * 0.05f;
|
||||
_climbT = 0f;
|
||||
_climbOver = false;
|
||||
Body.enabled = false;
|
||||
Sfx.Play("jump", 0.55f, 1f);
|
||||
Avatar?.Squash(0.15f);
|
||||
@ -570,12 +575,26 @@ namespace GrassCutter
|
||||
|
||||
void Climb()
|
||||
{
|
||||
_climbT += Time.deltaTime / 0.55f;
|
||||
_climbT += Time.deltaTime / (_climbOver ? 0.7f : 0.55f);
|
||||
float k = Mathf.Clamp01(_climbT);
|
||||
var mid = Vector3.Lerp(_climbFrom, _climbTo, 0.5f) + transform.up * 1.4f;
|
||||
var a = Vector3.Lerp(_climbFrom, mid, k);
|
||||
var b = Vector3.Lerp(mid, _climbTo, k);
|
||||
transform.position = Vector3.Lerp(a, b, k);
|
||||
if (_climbOver)
|
||||
{
|
||||
// up from the meadow: straight up the side until the feet clear the railing, over it, then down onto the deck
|
||||
var up = transform.up;
|
||||
float rise = Vector3.Dot(_climbTo - _climbFrom, up) + RailClear;
|
||||
var top = _climbFrom + up * rise;
|
||||
var over = _climbTo + up * RailClear;
|
||||
if (k < 0.45f) transform.position = Vector3.Lerp(_climbFrom, top, Easing.Apply(Ease.OutQuad, k / 0.45f));
|
||||
else if (k < 0.8f) transform.position = Vector3.Lerp(top, over, Easing.Apply(Ease.InOutQuad, (k - 0.45f) / 0.35f));
|
||||
else transform.position = Vector3.Lerp(over, _climbTo, Easing.Apply(Ease.InQuad, (k - 0.8f) / 0.2f));
|
||||
}
|
||||
else
|
||||
{
|
||||
var mid = Vector3.Lerp(_climbFrom, _climbTo, 0.5f) + transform.up * 1.4f;
|
||||
var a = Vector3.Lerp(_climbFrom, mid, k);
|
||||
var b = Vector3.Lerp(mid, _climbTo, k);
|
||||
transform.position = Vector3.Lerp(a, b, k);
|
||||
}
|
||||
if (k >= 1f)
|
||||
{
|
||||
_climbT = -1f;
|
||||
|
||||
Reference in New Issue
Block a user