Current version 1.5.0.08.26

Documentation

Configuration

Configure input, rod building, procedural bending, line behavior, casting, loot, bait, character, camera, interaction, and UI.

InputHandler

InputHandler adapts Unity Input System actions to readable properties used by the example and FishingSystem.

Assign these InputActionProperty fields:

  • Move: Vector2 movement input
  • Look: Vector2 camera input
  • Jump: button
  • Cast: button
  • Attract: button
  • Menu: button
  • Interact: button

The action map containing Cast must also contain an action named exactly ResetFishing. InputHandler resolves that action at runtime and validates every required action once in Awake.

The included FGTInputActions asset contains Keyboard and Mouse and Gamepad control schemes. Edit or replace its bindings without changing FishingSystem.

Fishing Rod Builder

Fishing Rod Builder converts one or more MeshFilter objects into a reusable FishingRod prefab with a generated skinned rig.

This section is a field reference. Follow the dedicated Rod Builder page for the complete model-preparation and baking workflow.

Open the builder

  1. Place the rod model in the scene.
  2. Select the root GameObject in the Hierarchy.
  3. Right-click the selected object.
  4. Select Fishing Game Tool > Create Fishing Rod.

The menu is enabled only when the selected hierarchy contains at least one MeshFilter with a Mesh.

Select flexible rod meshes

The Meshes To Combine list initially contains every MeshFilter below Rod Root.

Remove objects that must not bend, including reel parts, handles, decorative rigid parts, and unrelated children. The remaining meshes are combined, subdivided when required, weighted, and baked as one flexible SkinnedMeshRenderer.

Use Restore All Meshes to rebuild the list from the hierarchy. Assign optional reel meshes separately in the Reel section.

Place the root pivot

Pivot defines the root position of the generated prefab.

The baked prefab receives zero world rotation while the rod geometry keeps its current world-space orientation. This allows a source rod with rotations such as 90, 90, 0 to produce a prefab root with rotation 0, 0, 0 without visually rotating the model.

Place Pivot at a useful handle or ownership point. A distant source-model pivot does not have to be preserved.

Define the flexible part

  • Flexible Start: first point affected by procedural bending
  • Rod Tip: end of the flexible rod and default cast-line attachment
  • Minimum Bone Count: minimum generated bones from 2 to 32

The builder adds bones when necessary to keep generated spacing at approximately 0.15 world units or less. Generated Bone Count shows the final value.

Use Swap Start And Tip if the automatic direction is reversed.

Configure the line path

  • Reel Mount: first point of the permanent rod line
  • Line Guides: intermediate guide or eyelet positions
  • Rod Tip: final point and cast-line origin

Add guides in any order. The builder sorts them from Flexible Start to Rod Tip and parents each guide to the nearest generated bone. The permanent rod line updates from Reel Mount through every guide to Line Tip.

No line guide is required. Without guides, the permanent line connects Reel Mount directly to Line Tip.

Configure hand grips

  • Primary Position: primary hand target
  • Secondary Position: secondary hand target when no reel grip is assigned

When Reel Grip Mesh is assigned, the secondary grip is created automatically at Reel Grip Pivot and becomes a child of that pivot. The character's secondary hand then follows the rotating reel handle.

HandIK reads both grip transforms from FishingRod. Hand targets are no longer stored on the character's rod-handling object.

Configure reel rotation

The crank and spool are optional.

Crank settings:

  • Arm Mesh: rigid crank-arm MeshFilter
  • Grip Mesh: rigid handle-grip MeshFilter
  • Crank Pivot: world position of the crank rotation pivot
  • Grip Pivot: world position of the handle grip
  • Local Rotation Axis: crank axis in Rod Root local space
  • Rotations Per Meter: crank turns for one meter of reeled line

Spool settings:

  • Mesh: rigid spool MeshFilter
  • Spool Pivot: world position of the spool rotation pivot
  • Local Rotation Axis: spool axis in Rod Root local space
  • Rotations Per Meter: spool turns for one meter of reeled line

Scene handles display colored pivots, line paths, generated bones, and visible crank or spool axes. The generated grip preserves its orientation while its pivot follows crank rotation.

The crank and spool must use different MeshFilter objects. A grip requires an assigned crank arm.

Bake the prefab

Select Bake Fishing Rod Prefab and choose a project location.

The builder creates:

  • FishingRod prefab
  • Generated mesh asset beside the prefab
  • SkinnedMeshRenderer and generated bone hierarchy
  • ReelMount, LineGuide, LineTip, PrimaryHandGrip, and SecondaryHandGrip transforms
  • Optional ReelCrankPivot, ReelGripPivot, and ReelSpoolPivot transforms
  • Permanent RodLine LineRenderer
  • Main cast-line LineRenderer required by FishingRod

The builder temporarily enables Read/Write on source model importers when required and restores their original setting after baking. It assigns the included default line material when the target LineRenderer has no custom material.

FishingRod

Fishing Line Settings

  • Line Attachment: cast-line origin, normally generated LineTip
  • Resolution Range: LineRenderer point range from short to long distance
  • Simulate Gravity: vertical control-point offset for line sag, from -2 to 0
  • Color: start and end line color
  • Width: start and end line width

The cast line is a lightweight curved LineRenderer. Point count decreases with distance according to Resolution Range. When loot is caught, sag smoothly approaches zero and the line appears taut.

Fishing Line Status

  • Max Line Load: maximum stored load
  • Over Load Duration: time at maximum load before breakage
  • Max Line Length: movement and path limit used by the fishing runtime
  • Is Line Breakable: enables line failure after sustained overload

Current Line Length, Current Over Load, Current Line Load, Attract Float Speed, and Is Line Broken are runtime values.

When line breakage is disabled, overload time is cleared and the line does not break.

Procedural Bending

  • Stiffness: force required to reach full bend
  • Maximum Bend Angle: maximum distributed rotation across the generated bones
  • Bend Response: smoothing response toward the target bend
  • Bend Profile: distribution of bend from Flexible Start to Rod Tip

Automatic bending occurs only while loot is caught, a float is assigned, the generated rig is valid, and the line is not broken. The direction is calculated in the rod's local bending plane.

The public SetBendForce and SetBendTarget methods can drive the rig independently. ClearBendForce returns it toward the rest pose.

Fishing Rod Settings

  • Base Attract Speed: base reel-in strength before line-load, angle, and tier bonuses
  • Angle Range: range used by legacy attraction and line-load calculations

Debug Options expose the current float and loot-caught flag for manual rod testing.

FishingSystem

Fishing Settings

  • Fishing Rod: active FishingRod
  • Input Controller: InputHandler used for cast, attract, and reset
  • Fishing Layer: LayerMask that identifies fishable water
  • Bait: optional starting FishingBaitData

Input Controller is serialized privately but visible in the Inspector. FishingSystem validates all required references once in Awake.

Loot Settings

SpawnItem instantiates the selected loot prefab near the float and applies an impulse toward the player when the prefab has a Rigidbody.

InvokeEvent is retained for serialized compatibility but is not a completed reward path in this release. It logs a warning instead of delivering loot.

Cast and Attract Settings

  • Fishing Float Prefab: prefab containing FishingFloat and Rigidbody
  • Max Cast Force: maximum charged force
  • Force Charge Rate: charge added per second while Cast is held
  • Spawn Float Delay: delay used to synchronize float release with animation
  • Catch Distance: distance at which an empty float resets or caught loot is delivered

The float is spawned at FishingRod Line Attachment and receives force in the player's forward and upward direction.

Advanced Settings

  • Catch Probability Data: optional custom catch probabilities
  • Return Speed Without Loot: empty-float reel speed on water
  • Catch Check Interval: seconds between catch attempts
  • Caught Loot Data: current selected loot, read-only
  • Caught Loot: current catch state
  • Loot Weight: randomized current weight, read-only

Catch Check Interval is clamped to at least 0.01 seconds at runtime.

FishingFloat

  • Fishing Float Layer Mask: layers excluded from surface detection, normally the float's own layer
  • Checker Radius: OverlapSphere radius used to detect water and land
  • Enable Float Animations: enables optional curve-based child movement

Animation settings:

  • Float Representation: child visual moved on its local Y axis
  • Float Animation Curve: repeated curve sampled with Time.time
  • Anim Force: curve amplitude
  • Anim Speed: curve playback multiplier

FishingFloat keeps horizontal Rigidbody velocity at zero while water is detected. FishingSystem and FishingFloatPathfinder control the in-water position.

Fishing spots and loot

Add FishingLoot to the same GameObject as the water collider detected by FishingFloat. Populate its list with FishingLootData assets.

Create loot through Assets > Create > Fishing Game Tool > New Fishing Loot.

FishingLootData fields:

  • Loot Tier: Common, Uncommon, Rare, Epic, or Legendary
  • Loot Type: Fish or Item
  • Weight Range: randomized minimum and maximum catch weight
  • Loot Rarity: positive weighted selection value
  • Loot Name: display name
  • Loot Description: display description
  • Loot Prefab: delivered prefab

Rarity values are weights. They do not need to total 100. Null entries, non-positive weights, and tiers unavailable to the current bait are ignored before selection. If no eligible positive-weight entry exists, no loot is selected and FishingSystem safely returns to the waiting state.

Fish loot uses generated movement paths and avoidance. Item loot does not generate autonomous fish movement.

Bait and catch probability

Create bait through Assets > Create > Fishing Game Tool > New Fishing Bait.

FishingBaitData fields:

  • Bait Tier: Uncommon, Rare, Epic, or Legendary
  • Bait Name
  • Bait Description
  • Bait Prefab: optional object spawned when existing bait is replaced through AddBait

Without bait, Common loot is eligible. Bait raises the highest eligible loot tier to its own tier.

Create custom probability data through Assets > Create > Fishing Game Tool > New Catch Probability Data.

CatchProbabilityData stores Common, Uncommon, Rare, Epic, and Legendary probability thresholds plus Minimum Safe Fishing Distance Factor. Casts shorter than that distance scale the threshold down toward 30 percent of its configured value.

Example third-person character

CharacterMovement

CharacterMovement requires Animator and CharacterController. Assign InputHandler and CameraController.

Movement settings control move speed, ground acceleration, ground deceleration, air acceleration, character rotation, and animation smoothing.

Jump and Gravity settings control jump height, gravity, terminal velocity, grounded force, coyote time, and jump buffering.

Ground Detection requires the intended Ground Layers. Slopes configure maximum walkable angle, step offset, slide acceleration, maximum slide speed, retained steep-slope control, and a directional speed curve.

The Animator must contain:

  • Speed: float
  • Jump: trigger
  • IsGrounded: bool

CameraController

The refreshed example uses one third-person CameraController. Assign InputHandler, CharacterMovement, and one scene Camera.

General settings control mouse sensitivity, gamepad sensitivity, inverted vertical look, starting pitch, pitch limits, and look smoothing.

Third Person Framing controls distance limits, height, shoulder offset, vertical offset, and field of view. Motion settings add pivot smoothing, velocity look-ahead, distance by pitch, speed-based distance, and speed-based field-of-view response.

Camera Collision uses a SphereCast. Assign collision layers, radius, padding, and return speed. Character-owned colliders are ignored.

HandIK

HandIK reads PrimaryHandGrip and SecondaryHandGrip from FishingSystem's current FishingRod. Assign left and right elbow pole targets, the rod-handling Animator, and FishingSystem.

Enable IK Pass on the Animator layer that drives the character. The example rod-handling Animator uses CaughtLoot, AttractLoot, CastFloat, and AttractLootDir.

InteractionSystem

InteractionSystem searches within Interaction Radius and chooses the interactable closest to the center of the camera view within Interaction View Angle.

Assign:

  • Interaction Layer Mask
  • Interaction Mark UI or world object

An interactable requires a Collider on the interaction layer and InteractionHandler on that object or a parent. Configure its UnityEvent to call gameplay methods such as FishingSystem.SetBait.

SimpleUIManager

SimpleUIManager is an optional example HUD. It displays:

  • Cast-force progress
  • Fishing-line load and overload state
  • Current loot information
  • Input reference and menu controls
  • Fix Fishing Line and Exit buttons

Assign FishingSystem, menu root, loot text, optional loot background, line-load bar, and cast-force bar. Bars can fill horizontally or vertically and can use optional color gradients.

The example bait is added through scene interactions, not through the UI menu.