Implement SprayPattern node for weapon recoil and spray behaviors#182
Draft
Implement SprayPattern node for weapon recoil and spray behaviors#182
Conversation
Co-authored-by: krazyjakee <623463+krazyjakee@users.noreply.github.com>
…on tests Co-authored-by: krazyjakee <623463+krazyjakee@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Spray patterns
Implement SprayPattern node for weapon recoil and spray behaviors
Sep 29, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements the
SprayPatternnode, a reusable and customizable Godot 4.5 node that defines and manages recoil and spray behaviors for firearms. The node integrates seamlessly with the existing weapon system while maintaining modularity and backward compatibility.Features
The
SprayPatternnode provides comprehensive spray pattern functionality:Properties
All properties from the original feature request are implemented:
Integration
The node automatically integrates with the existing weapon system:
Usage Examples
Different weapon types can be easily configured:
Implementation Details
The implementation follows Nodot conventions and maintains minimal impact on existing code:
FirstPersonItem.gdfor automatic detection and integrationMagazineor weapon functionalityFiles Added
addons/nodot/weapons/SprayPattern.gd- Core implementationaddons/nodot/weapons/SprayPattern.md- Documentation and examplesaddons/nodot/icons/spray_pattern.svg- Custom node icontests/unit/weapons/SprayPattern.test.gd- Unit teststests/unit/weapons/SprayPatternIntegration.test.gd- Integration testsThe
SprayPatternnode enables developers to create realistic and varied weapon behaviors that can range from Counter-Strike-like deterministic patterns to arcade-style random recoil, all while ensuring perfect synchronization between visual recoil and bullet trajectory.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.