Skip to content

Props gibs should inherit velocity for most cases and prevelocity only for impact kills. - #11079

Closed
Xenthio wants to merge 4 commits into
Facepunch:masterfrom
Xenthio:pr/prevelocity-only-on-impact
Closed

Props gibs should inherit velocity for most cases and prevelocity only for impact kills.#11079
Xenthio wants to merge 4 commits into
Facepunch:masterfrom
Xenthio:pr/prevelocity-only-on-impact

Conversation

@Xenthio

@Xenthio Xenthio commented May 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Currently, prop will not have any just applied velocity handed down to their gibs, which means in basically all cases, props shot by bullets have their gibs unnaturally drop in place.

Motivation & Context

any just applied velocity is stomped by the impact damage prevelocity

Implementation Details

I added a comment in code about why I thought prevelocity was probably chosen in the first place, and why we don't need it for most cases.
This is 100% human slop, no AI did the thinking or bug finding here.

Screenshots / Videos (if applicable)

https://github.com/user-attachments/assets/5e8dc69c-c801-4059-9438-7f5fcf0f172e
(This video implement another fix for sandbox gamemode, which reorders bullet impact forces to be applied before damage, http://github.com/Facepunch/sandbox/pull/274)

Checklist

  • Code follows existing style and conventions
  • No unnecessary formatting or unrelated changes
  • Public APIs are documented (if applicable)
  • Unit tests added where applicable and all passing (N/A here)
  • I’m okay with this PR being rejected or requested to change 🙂

Copilot AI review requested due to automatic review settings May 29, 2026 22:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

Adds damage context to prop destruction so gib creation can vary behavior (notably for impact breaks) and inherit appropriate rigidbody velocities.

Changes:

  • Thread DamageInfo through KillOnBreak to detect impact breaks.
  • Extend NetworkCreateGibs / CreateGibs to accept a wasImpact flag.
  • Use PreVelocity / PreAngularVelocity for gib physics only when broken by impact.

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

Comment thread engine/Sandbox.Engine/Scene/Components/Game/Prop.cs Outdated
Comment thread engine/Sandbox.Engine/Scene/Components/Game/Prop.cs Outdated
@handsomematt
handsomematt force-pushed the pr/prevelocity-only-on-impact branch from 2e97483 to f6bcada Compare June 8, 2026 07:48
@handsomematt handsomematt added the triaged triaged pull-requests are replicated on the internal sbox repo label Jun 8, 2026
@sboxbot sboxbot added the accepted this pull request was accepted, hurrah! label Jun 8, 2026
@sboxbot

sboxbot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

This PR has been merged upstream.

@sboxbot sboxbot closed this Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accepted this pull request was accepted, hurrah! triaged triaged pull-requests are replicated on the internal sbox repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants