Skip to content

Parent decals to hitbox bone, if a hitbox is found - #278

Open
Xenthio wants to merge 1 commit into
Facepunch:mainfrom
Xenthio:pr/bone-decal-parenting-fix
Open

Parent decals to hitbox bone, if a hitbox is found#278
Xenthio wants to merge 1 commit into
Facepunch:mainfrom
Xenthio:pr/bone-decal-parenting-fix

Conversation

@Xenthio

@Xenthio Xenthio commented Jun 5, 2026

Copy link
Copy Markdown

Parent decals to hitbox bones if found so that they follow along and look better.

Desktop.2026.06.05.-.11.51.13.10.mp4

Copilot AI review requested due to automatic review settings June 5, 2026 01:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR improves bullet impact effects on skinned meshes by using the hitbox’s bone index (when available) to parent decals/impacts to the correct bone, with a fallback to nearest-bone selection.

Changes:

  • Extract bone index from the trace hitbox and pass it into ShootEffects.
  • Extend ShootEffects to accept a boneIndex and use it to select a bone for decal parenting.
  • Retain a fallback path that finds the closest bone transform when no valid index is available.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


[Rpc.Broadcast]
public void ShootEffects( Vector3 hitpoint, bool hit, Vector3 normal, GameObject hitObject, Surface hitSurface, Vector3? origin = null, bool noEvents = false )
public void ShootEffects( Vector3 hitpoint, bool hit, Vector3 normal, GameObject hitObject, Surface hitSurface, int boneIndex = -1, Vector3? origin = null, bool noEvents = false )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants