ModdedWolf-BowTrajectory icon

BowTrajectory

Shows the predicted arrow/bolt flight path with an impact marker while drawing a bow or crossbow.

Last updated 3 days ago
Total downloads 152
Total rating 0 
Categories Mods Tweaks Client-side Utility
Dependency string ModdedWolf-BowTrajectory-1.0.2
Dependants 0 other packages depend on this package

This mod requires the following mods to function

denikson-BepInExPack_Valheim-5.4.2202 icon
denikson-BepInExPack_Valheim

BepInEx pack for Valheim. Preconfigured and includes unstripped Unity DLLs.

Preferred version: 5.4.2202

README

Bow Trajectory

A lightweight, client-side Valheim mod that draws the predicted flight path of your arrow/bolt in real time while you draw a bow (or aim a crossbow), ending in a marker where it's predicted to land.

It reads the real launch values from the game each frame (draw strength, projectile speed, gravity, drag) and simulates the exact same physics the projectile uses, so the line matches where the arrow will actually go.

  • Purely visual / client-side. It does not change any gameplay values, so it's safe in single-player and on servers that don't have the mod installed.
  • Works with bows and crossbows, and adapts to your current ammo (different arrows have different speeds/gravity).

Requirements

  • Valheim (PC)
  • r2modman (or Thunderstore Mod Manager) with a Valheim profile that has BepInExPack Valheim installed
  • For building from source: the .NET SDK (8.0+)

Install with r2modman

  1. Install r2modman, choose Valheim, and create (or select) a profile.
  2. In that profile, install BepInExPack Valheim (r2modman pulls it in as a dependency for most mods; if it isn't there, install it from the Online tab).
  3. Launch the game once through r2modman (Start Default) so the profile's BepInEx folders are generated.
  4. Drop BowTrajectory.dll into the profile's plugins folder: %APPDATA%\r2modmanPlus-local\Valheim\profiles\<ProfileName>\BepInEx\plugins\ (or import it via r2modman's Import local mod).
  5. Launch Default and equip a bow.

If you build from source (below), the build copies the DLL into your profile automatically.

Show it in the r2modman mod list (Import local mod)

r2modman only lists mods that were installed through it. To have it appear and be managed (recommended), import the packaged zip:

  1. Build the package: dotnet build -c Release -t:Package (produces dist\BowTrajectory-<version>.zip).
  2. In r2modman, select your profile, then Settings -> Import local mod and choose that zip.
  3. Start Default.

Do not also drop the loose DLL into BepInEx\plugins\ when using the imported version, or BepInEx will see the plugin twice (duplicate GUID) and skip loading it.

Usage

  1. Equip a bow or crossbow and select arrows/bolts.
  2. Hold to draw the bow — the trajectory line appears and updates as your draw strength increases. For crossbows it appears while aiming.
  3. Release to fire; the arrow follows the predicted path.
  4. Press B in-game to toggle the preview on/off (configurable).

Configuration

Settings live in the BepInEx config file and can also be edited live with a config manager mod. File location: %APPDATA%\r2modmanPlus-local\Valheim\profiles\<ProfileName>\BepInEx\config\dev.modded.bowtrajectory.cfg

Section Key Default Description
General Enabled true Master on/off.
General ToggleKey B Hotkey to toggle the preview in-game.
General MinDrawPercent 0.05 Only show the bow path once the draw passes this fraction (0-1).
General ShowForCrossbows true Also show the path while aiming a crossbow.
General StopAtCharacters true If true, the path and impact marker stop on creatures/animals/players too, not just terrain/structures. Set false to let the line pass through characters.
Appearance StartColor white Line color near the bow.
Appearance EndColor red Line color near the impact point.
Appearance LineWidth 0.06 Line width (meters).
Appearance ShowImpactMarker true Show a ring where the arrow is predicted to land.
Appearance ImpactColor red Impact ring color.
Appearance ImpactMarkerSize 0.5 Impact ring radius (meters).
Advanced MaxPoints 400 Max simulated points along the path. The simulation always uses the game's live physics timestep so the arc matches the real arrow.

How it works

Each frame, while a bow/crossbow is drawn, the mod:

  1. Reads the launch point and aim direction the game would use (Attack.GetProjectileSpawnPoint).
  2. Computes the launch speed from the bow's m_projectileVel/m_projectileVelMin and the current draw percentage via the bow's m_drawVelocityCurve (plus any bonus from the selected ammo).
  3. Reads m_gravity/m_drag from the arrow's projectile prefab.
  4. Steps the projectile forward using the same integration as Projectile.FixedUpdate (vel += down * gravity * dt, quadratic drag, pos += vel * dt) at the game's live Time.fixedDeltaTime, raycasting each segment against terrain/structures until it hits something.
  5. Feeds the points into a LineRenderer and places the impact ring at the first hit.

Notes

  • Accuracy spread is intentionally ignored so the line shows the true center aim, not the random cone.
  • Built against your installed Valheim version's assemblies. After a major Valheim update, rebuild from source if member names changed.