Add PlayerAnimationSync NetworkBehaviour with owner-authoritative
NetworkVariables for pose index and locomotion category (idle/walk/run/fall).
Remote avatars switch their PlayerPoseController into network-controlled mode,
skipping local input, sprint reset, capsule resize and camera framing, and
take pose index plus locomotion externally. Disable pose persistence on
network-driven remotes so foreign avatars can't overwrite the local save.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Install Netcode for GameObjects 2.13.0 + Unity Transport 2.6.0 and wire up
the first networking milestone: syncing player position/rotation across clients.
- NetworkBootstrap: Host/Client/Server controls (OnGUI + H/C hotkeys) for
local clone testing over loopback 127.0.0.1:7777.
- NetworkPlayerSetup: per-avatar owner gating. The local owner binds the
GameModeManager and cameras to itself; remote avatars disable their
controller/CharacterController and receive transform via NetworkTransform.
- GameModeManager.BindLocalPlayer: central runtime rebind to the locally
spawned player.
- FirstPersonController.SetPlayer: explicit runtime rebind hook.
- Player prefab: NetworkObject + NetworkTransform (owner-authoritative,
position + rotation) + NetworkPlayerSetup; registered as PlayerPrefab.
- Scene: NetworkManager + UnityTransport added; the fixed scene player
instance removed in favor of spawn-on-connect.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Play a dedicated falling animation when the player is airborne and
descending past a scale-aware velocity threshold.
- PlayerCharacterController: new IsFalling state + Fall Animation Speed
threshold (true only when !grounded && !wallClimbing && descending,
scaled via CapsuleScale); explicitly false during wall/ceiling climb.
- PlayerPose: per-pose Fall Clip + Fall Clip Speed (mirrors walk/run).
- PlayerPoseController: select the fall clip while falling, fall back to
the idle clip when a pose has none (no regression).
- Author content: Paintman-Fall.anim assigned to Pose_Idle; UMotion
project, Player prefab and scene authoring.
- Docs: check off the fall animation in GAME_DESIGN.md.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
When running backwards toward the camera into a wall, the grab decided on
the camera-relative world direction (S pushes into the wall -> grab) while
the base release decided on the raw S axis (v < 0 -> immediately let go),
causing a per-frame grab/release flicker.
Mirror the existing _wallStrafeSign A/D latch with a new _wallClimbSign:
the camera picks, per climb-key press, which of W/S climbs up (the one
pushing into the wall) via Dot(camForward, wallNormal) and latches it.
All up/down tests now run through the effective climb axis vEff -
wall->ceiling handoff, top-out detach/hop, the alongSurface mapping and
the base release - so grab and release can no longer contradict each
other. Reset on grab and in ExitWallClimb. Facing the wall and grabbing
with W is unchanged (vEff == v).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Introduce a FirstPersonController / FirstPersonMode pair (mirroring the
free-cam mode) wired into the GameModeManager Tab cycle. In first person the
mesh is hidden, the eye sits on CameraTarget plus a per-pose
firstPersonCameraTargetYOffset, and the character body yaw is driven to match
the camera via a new single-writer FaceYaw hook on PlayerCharacterController.
Also includes user content edits (poses, prefabs, scene) carried along.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
FreeCamController: ease movement via dt-correct Vector3.SmoothDamp on a world-space velocity (accel/decel ramp) and lag the look with Mathf.SmoothDampAngle. Both are framerate-independent and collapse to instant at smoothTime 0; smoothed state is snapped on activation (SyncToCurrentView) so entering freecam never jumps to catch up.
Bundles accumulated deferred work: PlayerScaler uniform-scale helper, scale-aware wall/ceiling climb probes and the double-scale skinned-collider bake fix, plus user content authoring (Sit pose + animation, font SDF, scene/prefab edits).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
In an inner wall/ceiling corner the body's facing flipped ~9 deg every
frame. Recorded frame data showed the wall/ceiling classification flipping
160 times: _wallNormal.y swung the full range (0.0 wall <-> -0.966 ceiling)
each frame, far past the hysteresis band, so the Schmitt trigger could not
hold it.
Root cause: _wallNormal had two competing per-frame sources.
- The contact-normal blend (Update) mixes ceiling and wall contacts in the
corner into ~(0,-0.97,-0.26), classified as ceiling.
- ProbeWall raycasts along -_wallNormal, which tilts toward the wall, so the
ray clips the wall and returns (0,0,-1), classified as wall.
Wall and ceiling drive different rotation targets (snap to face-wall vs.
face movement direction), producing the per-frame twitch.
Fix:
- The contact blend no longer overwrites _wallNormal during an active climb
(it only seeds the initial grab); the probes own the normal while climbing.
- Surface-aware probing: on a ceiling, probe straight up (ProbeCeiling)
instead of along -_wallNormal, so the angled ray can no longer clip the
wall and demote us. Stay latched on the ceiling until it is genuinely gone
overhead, then fall back to the wall probe.
Also retains the ceiling-class hysteresis (Schmitt trigger on the normal's
downward tilt) from the prior attempt as added stability.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Each PlayerPose now carries its own collider center Y, radius and height,
eased and routed to the CharacterController via a SetCapsule single-writer.
This lets crawl poses (Ball/Star) shrink the capsule to fit under furniture.
The ceiling Y offset is removed; poses without authored sizes fall back to
the base capsule, so existing poses keep their collision.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace unreliable raycast parity on open-shell meshes with editor-baked
voxel grids. ConcealmentVolume bakes an inside-mask per object using the
union of a generalized-winding-number test (solid material, robust to open
shells) and an exterior flood-fill (enclosed cavities). ConcealmentMeter
now prefers baked volumes via an O(1) world-space lookup through a registry,
falling back to the old concave parity only for un-baked colliders.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Introduce a free-fly camera as the next entry in the Tab mode cycle
(Player Control -> Paint -> Free Cam):
- FreeCamController: dedicated CinemachineCamera plus a CharacterController
mirroring the player capsule (radius 0.1, height 1.3, slope 59, step 0.15)
so the free camera collides with walls/ceiling/floor exactly like the
player. WASD/Q-E (and Space/Ctrl) fly relative to view; mouse looks.
- FreeCamMode: plain-C# GameMode mirroring PaintMode, with an Exit() that
restores camera priority and re-enables player control + camera input.
- GameModeManager: register freeCam in the Tab cycle (gated like player).
- Scene: FreeCamera object wired, Main Camera custom blends (0.4s) for the
vcam priority hand-off.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add cameraTargetYOffset to PlayerPose so each pose can offset the
Cinemachine ThirdPersonCamera follow/look target independently of the
body mesh. PlayerCharacterController gains a cameraTarget reference
(auto-resolved via the "CameraTarget" child, base position captured in
Awake) and a single-writer SetCameraTargetLocalYOffset. PlayerPoseController
eases the per-pose camera offset and composes it with the shared ceiling
offset, so the camera target follows the ceiling lift in lockstep with the
mesh. Wire cameraTarget explicitly in SampleScene.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Import Barking Dog's free URP-ready interior asset (~41 MB, 155 assets:
meshes, textures, materials, prefabs) as the small interior map, and
populate SampleScene with its geometry.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- PlayerPoseController: add applyFootIK toggle (default off) and apply it
to each pose playable so straight-knee idles render straight; Mecanim
foot IK was bending the knees to plant the feet (162° instead of 180°).
- Add Pose_Ball / Paintman-Ball animation and reorder the pose list.
- Move StraightenKneesTool editor utility under Assets/Unused/Editor.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Import Mixamo humanoid Walking + Running FBX, switch rig type to Humanoid
- Wire walkClip/runClip with per-clip speeds on Pose_Idle (walk 1.4, run 1.5)
- Add per-animation speed sliders (Range 0.1-3, default 1) to PlayerPose SO,
applied per frame in PlayerPoseController for live tuning
- Reorganize pose assets: replace Pose_TPose with Pose_Hold, prune legacy
Paintman-Run/-TPose .anim and paintman_UV.FBX
- Ignore UMotion plugin data/editor folders
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- ConcealmentMeter: standalone component measuring the percentage of the
character volume embedded inside environment geometry (bake -> voxelize via
column ray-stabbing parity -> classify interior voxels against box/sphere/
capsule/convex colliders and terrain). Always-on, throttled, gizmo debug.
- SkinnedColliderBaker: sole per-frame collider bake owner for skinned rigs.
MeshPainter now delegates baking and only borrows BakedMesh for the GPU
raster and cache refresh, so the collider stays fresh outside paint mode.
- Move pose assets to Assets/Poses, retire unused Insect scripts to
Assets/Unused, restore Paintman.controller; mode scripts and scene updated.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the hard pose snap with a 2-input AnimationMixerPlayable crossfade:
the running pose moves to input 0 (keeping its play time), the new pose to
input 1, weight ramps over poseBlendDuration (smoothstep). Per-frame rest
reset stays, so empty/partial clips still resolve to rest during and after
the blend. Ceiling Y-offset now eases via MoveTowards (ceilingOffsetSpeed)
on enter/exit/pose-change instead of snapping.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
New PlayerPose ScriptableObject (AnimationClip + ceiling Y-offset) and
PlayerPoseController that drives poses via a PlayableGraph, overriding the
Animator controller. Poses are held continuously (idle, moving, on wall/
ceiling) so cycle and sprint changes show immediately. Sprinting in any
state resets to pose 0. Non-keyed bones fall back to a captured rest pose
so empty/partial clips apply fully. Ceiling Y-offset is folded into the
controller's single mesh-offset writer.
PlayerCharacterController gains IsIdle / IsSprinting / IsOnCeiling /
AnimatorOverridden accessors and SetPoseLocalYOffset; SetAnimatorRunning is
guarded while a pose owns the Animator. Removed obsolete Paintman.controller.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
PlayerCharacterController:
- Wall lean now moves only the visual model + its paint collider (auto-resolved
mesh root parenting both renderer and bones), not the CharacterController
capsule, so the mesh can sink into the wall (wallMaxInset) as well as lean out
(wallMaxOffset); capsule stays flush.
- Lean eases back to the authored pose when leaving the wall instead of snapping.
- Sprint multiplier now also applies while wall/ceiling climbing.
- Separate wallMantleSpeedMultiplier for pulling up over the top edge,
independent of the climb speed.
Assets:
- Re-exported paintman_UV.FBX and added Paintman.blend: rescaled armature to
mesh, merged seam duplicate vertices, fresh automatic weights, inner-thigh
weight fix (no webbing on leg spread).
- Updated anims, animator controller, font SDF and scene.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add player position/rotation/wall-climb persistence and camera
orbit (yaw/pitch/radius) persistence, auto-saved on quit/play-stop
and auto-loaded on start. Also includes the wall-climb fixes
(directional top-out, base detach on push-away).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the CPU island-mask dilation guard on the GPU backend with a
coverage pass rendered through the same brush rasterizer, so sub-pixel
rim texels that the GPU brush can never reach fall into the gutter and
stay paintable (no more frozen loaded pixels at island edges).
Also includes user content: additional brush masks (dirt) with an
expanded mask selector in the HUD prefab, and CharacterController /
wall-climb inspector tuning.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Add mask selector with previews to the brush card (data-driven from
painter.brushMasks); persist activeBrushIndex with HUD layout.
- Fix alpha/coverage artifacts when overpainting after load or backend
switch: derive the dilation source marker from a deterministic UV island
mask instead of resetting it to "unpainted" on every seed.
- Import the two final brush mask textures (Brushes/).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Move font (arialroundedmtprocyr_bold) into Assets/Fonts and the Paintman
model, animations, and animator controller into Assets/Models. Pure file
relocation; .meta files moved alongside their assets so GUIDs are preserved.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add MeshPainter.Persistence.cs: auto-save the three canonical paint maps
(albedo, MSO, emission) as PNGs under persistentDataPath on quit/play-stop
and auto-load them as the backend seed on start, so painting survives
sessions. Reuses the existing ReadCanonical/SetupBackend seed round-trip;
no new color-space code.
Add PaintHud.Persistence.cs: auto-save draggable panel positions and the
widget-bound painter values to a small JSON layout file, restored on start
via the painter -> SyncFromPainter -> widgets path. Complete SyncFromPainter
to also cover the spray sliders.
- PlayerCharacterController: latch the wall-strafe sign once at strafe
start instead of re-deriving it from the camera every frame, which
flipped at the 90-degree point while circling a cylinder and caused a
back-and-forth lock. Flat walls stay bit-identical; reset on enter/exit.
- MeshPainter.Pick: dispatch terrain hits to a splat-layer blend (full
PBR channels), terrain trees / grass / sky to rendered screen-color,
keeping texel-accurate picks for the paint mesh and foreign materials.
- Includes Unity auto-reserialization of SampleScene and three Supercyan
pack assets (URP material upgrades, skybox/lighting) from the import.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Reset the pipette toggle after a successful pick so each pick is a
one-shot action (HUD toggle follows via the Picked sync). Split the
wall-climb pose drag so the lean-out offset stays on LMB while body
rotation moves to RMB, letting both be held independently. Also pulls in
the terrain physics module and the user's scene setup for the terrain
test area.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The pipette now raycasts the nearest collider of any object, not just the
paint mesh. On a foreign hit it reads all channels texel-accurately from the
object's material maps (BaseMap/MetallicGloss/Occlusion/Emission) combined
with the material scalars per URP/Lit conventions, falling back to scalar
properties where a map is missing or the collider yields no UV. Includes
scene test props and materials for verifying foreign-object picking.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
After a successful pipette pick the painter now enables all four paint
channels (albedo, metallic/smoothness, occlusion, emission) and raises a
Picked event. The HUD subscribes and re-syncs every widget (toggles,
sliders, both colour pickers) to the adopted brush values.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Pipette samples all painted channel values (albedo, metallic, smoothness,
occlusion, emission) at the clicked texel and adopts them into the brush
with every opacity forced to 1, instead of painting. The screen raycast is
extracted into a shared TryRaycastPaintMesh helper used by painting, preview
and the pipette. A pipette toggle is added to the HUD panel prefab and wired
in PaintHud.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Spray brush mode: bakes a procedural scattered-dot mask per stamp (random
position, size, alpha within the brush disc) and paints it through the
existing single-stamp pipeline; dot centers clamped to (0.5 - dotR) so the
spray footprint matches the solid brush radius.
Paint interval: float on MeshPainter; 0 keeps the continuous interpolated
stroke, >0 emits a single timed dab every x.xx seconds.
Color picker alpha: horizontal alpha bar on both HSV pickers, runtime-built
in Rebind (no prefab re-bake), passed through to brushColor.a / emissionColor.a.
Metallic/smoothness + occlusion paint opacity: new opacity fields applied in
both CPU and GPU backends (GPU MSO draw split into MS and occlusion sub-stamps
for independent opacity), with cloned alpha sliders wired into the HUD.
Also includes the prefab layout tweaks and scene adjustments.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Each channel panel (Albedo, Metallic+Smoothness, Occlusion, Emission)
gets a CanvasGroup whose alpha follows its toggle: 1.0 when enabled,
0.5 when disabled. Ensured at runtime in WirePanel (no prefab re-bake),
so both the prefab and code-gen paths behave identically. Panel_BrushSize
has no toggle and is left untouched.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Drag a panel from anywhere on its surface (header, padding, labels,
background) instead of only the header. Dragging is cancelled when the
press starts on an interactable (Selectable toggle/slider or the color
picker's UiPointerSurface), so widgets stay fully operable. Clamping is
now anchor/pivot-agnostic, computed from the panel's real corners, so
panels anchored bottom-center stay reachable in every screen corner.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Assign the baked PaintHudPanel prefab to the scene PaintHud, lower the
emission intensity and brush size defaults, and adjust camera and hand
rest positions.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Split the single HUD panel into four independent per-channel sub-panels
plus a global brush-size panel, each a standalone RectTransform with its
own header (drag-handle ready). PaintHud now binds to a baked layout
prefab via recursive name lookup instead of building everything in code,
with a code-gen fallback. HsvColorPicker gains Rebind() to re-apply the
procedural gradient sprites and drag relays that a prefab cannot serialize.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add a code-driven HUD that appears in paint mode and binds live to the
active MeshPainter: four channel toggles, HSV pickers for albedo and
emission, sliders for metallic/smoothness/occlusion, emission intensity
and brush size. The HUD self-assembles its own overlay canvas and event
system at runtime.
Add a ModeChanged event to GameModeManager so the HUD can follow the
active mode, and guard MeshPainter against painting through the UI.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add the new Player (Variant 2, Hand) with HandIK and the InsectController,
boot directly into Insect mode, and apply Unity-managed serialization updates
to the physics, renderer, and post-process settings assets.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add InsectController (transform-driven SphereCast surface following, no
CharacterController/Rigidbody, no gravity or slope limit) and InsectMode as a
third game mode. Wire it into GameModeManager with conditional registration so
PlayerControl and Insect modes only join the Tab cycle when their controller is
present. PaintMode/PlayerControlMode toggle the insect controller accordingly.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adds the HandIK component to Player/WhiteHand with handRoot wired to the
Hand node so the finger IK system is active in the scene.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
FingerIK: per-finger hinge-constrained CCD solver over a local +Y bone
chain. Procedural curl seed (rest-relative) blended with optional IK
reach toward a target via ikWeight, plus a lateral DOF on the base joint
so targets can pull fingers slightly sideways and upward (back-of-hand).
Runs in edit mode via [ExecuteAlways] + an EditorApplication.update tick.
HandIK: auto-discovers the five fingers under the hand root, wires a
FingerIK per finger (thumb gets its own limits), exposes inspector target
slots, and drives all solves once per frame/tick. Pushes the rig curl
hinge axis (-X) and limits centrally so re-discovery corrects already
serialized components. Live ikWeight broadcast; non-destructive target
resolution (a FingerIK's own target survives an empty manager slot).
Input signature is additive so every finger refreshes live while dragging.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>