diff --git a/JotunnModStub/Fenrir/FenrirFormShared.cs b/JotunnModStub/Fenrir/FenrirFormShared.cs index f412620..3922be6 100644 --- a/JotunnModStub/Fenrir/FenrirFormShared.cs +++ b/JotunnModStub/Fenrir/FenrirFormShared.cs @@ -66,8 +66,15 @@ namespace RacesOfValheim // sneaking in a form slid across the ground in the idle pose. Crouched, the player moves // at sneaking speed, and the creature's controller picks its walk for a speed that low: // the sneak a player asked for, from animations the creature already has. - try { form.SetFloat("forward_speed", grounded ? playerAnim.GetFloat("forward_speed") : 0f); } catch {} - try { form.SetFloat("sideway_speed", grounded ? playerAnim.GetFloat("sideway_speed") : 0f); } catch {} + // + // Sitting reads as still too. The seated player's own Animator keeps a forward_speed that + // is not zero, and passed through it kept the Ulv in its Walk clip - on the spot, and out + // of reach of its Sleep state, which only leaves from idle. Seen in the log: sitting, + // sleeping=true, clip 'Walk'. + bool sitting = IsSitting(player); + bool still = !grounded || sitting; + try { form.SetFloat("forward_speed", still ? 0f : playerAnim.GetFloat("forward_speed")); } catch {} + try { form.SetFloat("sideway_speed", still ? 0f : playerAnim.GetFloat("sideway_speed")); } catch {} // Sitting puts the creature to sleep, on the "sleeping" bool its own MonsterAI uses - the // Ulv curls up. IsSitting reads the animator's state, which is replicated, so it is right @@ -87,7 +94,7 @@ namespace RacesOfValheim (hasSleeping ? "sitting puts it to sleep." : "sitting keeps it idle.")); } } - if (hasSleeping) form.SetBool("sleeping", IsSitting(player)); + if (hasSleeping) form.SetBool("sleeping", sitting); return grounded; }