AttackDirectionFix

版本 v1.2.7·更新於 2025-12-10

Fixes attacks not always aiming where your crosshair is. Also known as the "Pierce Bug".

截圖 共 3 張

模組介紹 作者原文

Attack Direction Fix

Fixes attacks not always aiming where your crosshair is. Also known as the "Pierce Bug".

The problem

There are 2 relevant components here. The Aim Origin and the Aim Direction

The Aim Origin is the point on the character where most attacks (projectiles, bullets, and a few other things) originate from, usually located in the upper torso of the survivor.

The Aim Direction is the direction attacks should go in, this is determined from the camera's rotation.

However, the game can't just use the Aim Origin with the raw facing direction of the camera, since that would mean projectiles never impact where you're aiming (they would always be offset down slightly).

The simple fix for this is to figure out what the player is looking at (closest object that is under your crosshair), then offset the Aim Direction such that a straight line from the Aim Origin will intersect the camera view direction at that point. This is what the game does normally.

This works just fine for attacks that don't pierce, but looking at the image above, if the attack is allowed to continue through the target, the attack will follow the Actual path, not the Expected path, and it will seem to tilt up slightly after it pierces, this is what's known as the "Pierce bug".

A slightly less-brought-up issue that this causes is the following scenario:

Even though your crosshair is over the Lemurian, some object is obstructing the line between your Aim Origin and the target, which will cause your attacks to unexpectedly impact the obstruction instead.

The solution

The solution this mod uses is to always use the camera as the Aim Origin and the raw camera orientation as the Aim Direction. This makes all attacks perfectly follow where your crosshair is at all times.

Projectiles shooting straight out of the camera looks bad however. So one final thing the mod does is for a short period of the projectile's lifetime, projectiles visuals are offset to appear to come out of the model as usual, and over-time interpolate to the actual path. Projectile collision and everything logic related follows the Actual path while everything visual follows the Visual path before lining up with the Actual path after a short while.

Mod Developers

This mod shouldn't cause any problems by itself, but if you need precise control over projectile spawn position and rotations, you can add your projectile(s) into this mod's blacklist via the ProjectileAttributes.BlacklistProjectile methods

安裝與使用 安裝:BepInEx 外掛

  1. 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
  2. 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
  3. 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
  4. 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。

帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。

前置依賴

下面這些內容需要先安裝,否則該模組不會生效:

bbepis-BepInExPackRiskofThunder-HookGenPatcherRiskofThunder-R2API_Core

檔案與校驗

檔案名稱
AttackDirectionFix-1.2.7.zip
檔案大小
79.9 KiB