Skip to content

Party Visuals

PartyVisuals is the visual layer for party movement. It listens to GridCoreBridge events and animates the party's transform — slide, turn, wall-bounce, and step-bob. It contains no game logic: all movement decisions happen in the grid system; PartyVisuals only plays them back on screen.

Put the component on the party root — the same GameObject that holds the player camera as a child.

sequenceDiagram
    participant G as GridCoreBridge
    participant V as PartyVisuals
    participant C as Camera (child)
    G->>V: OnPartyMoved (from, to)
    V->>C: AnimateMove (slide + step bob)
    G->>V: OnPartyTurned (rotation)
    V->>C: AnimateTurn (slerp)
    G->>V: OnPartyBlocked (direction)
    V->>C: AnimateBounce (nudge + return)

Setup

  1. Select the party root GameObject (the one whose child is the player Camera).
  2. Add Component → Party Visuals.
  3. Tune the animation and audio fields in the Inspector (all have sensible defaults).
  4. Assign footstep AudioClips and optionally a hit sound — the component creates its own AudioSource.

That's it. The component self-registers with GridCoreBridge on Start and snaps the transform to the party's current grid position automatically.


Inspector reference

Movement Animation

Field Default What it does
Move Duration 0.25 s Length of the slide when stepping one cell.
Turn Duration 0.18 s Length of the 90° turn animation.
Move Curve EaseInOut Easing applied to translation during a step.
Turn Curve EaseInOut Easing applied to rotation during a turn.

Step Bob

The party root bobs up slightly on each step, selling the feel of walking.

Field Default What it does
Bob Height 0.06 m Peak vertical offset during a step.
Bob Curve 0 → 1 → 0 Shape of the bob over the course of one step. The default rises to the peak at the midpoint and returns to baseline on landing.

Bob vs PartyBobbing

PartyVisuals has a built-in one-shot bob that fires on each discrete step (tied to moveDuration). PartyBobbing adds a continuous sinusoidal bob while the party is animating — useful for an idle-walk feel. You can use both together or just one.

Audio

Field Default What it does
Footstep Sounds One or more AudioClips. A random one plays on each OnPartyMoved event.
Footstep Volume 1 Volume of footstep playback.
Party Hit Sound AudioClip played when any party member takes damage.
Party Hit Volume 1 Volume of the hit sound.

Blocked Animation

Field Default What it does
Bounce Distance 0.15 m How far the camera nudges toward the wall before snapping back.
Bounce Duration 0.15 s Total duration of the nudge-and-return animation.

Debug

Field What it shows
Current Facing Read-only. The party's current Direction — updated every frame in the Editor.

Events

Event When it fires
OnMoveAnimationComplete After the slide to a new cell finishes.
OnTurnAnimationComplete After the 90° turn finishes.
OnBounceAnimationComplete After the wall-bounce returns to start.

Public API

Member Description
bool IsAnimating true while any move, turn, or bounce coroutine is running.
bool suppressNextBounce Set to true to skip the next bounce (used by e.g. ChestTrigger when the party faces a chest). Resets automatically after one use.
TeleportTo(Vector3, Quaternion) Instantly repositions the transform and stops any in-progress animation — used on save/load.
CancelCurrentAnimation() Stops the current coroutine (used by PartyLook during snap-turns).

How it wires up at runtime

On Start, PartyVisuals fetches IGridSystem from CrawlerServices and casts it to GridCoreBridge. If the cast fails the component disables itself. It then subscribes to three bridge events:

  • OnPartyMovedAnimateMove
  • OnPartyTurnedAnimateTurn
  • OnPartyBlockedAnimateBounce

On OnDestroy it unsubscribes all events cleanly, including ISaveSystem.OnGameLoaded (which calls TeleportTo after a save is loaded) and ICombatSystem.OnPartyMemberHit (which plays the hit sound).


Troubleshooting

Party teleports instead of sliding

PartyVisuals wasn't found by GridCoreBridge — check that the component is on the party root and the scene has a GridCoreBridge.

Footstep sounds don't play

Make sure at least one AudioClip is in the Footstep Sounds array. The component adds its own AudioSource at Start; if you add a second AudioSource manually the component uses the first one it finds via GetComponent.

The party snaps back to origin on load

OnGameLoaded fires and calls TeleportTo. Make sure ISaveSystem is registered in CrawlerServices before PartyVisuals.Start runs, or that the save system fires OnGameLoaded after the scene is fully ready.


Dungeon Crawler Framework — Mantis3de