# Table of Contents - [Project Setup | SneakyKittyGameDev Docs](#project-setup-sneakykittygamedev-docs) - [Using the framework | SneakyKittyGameDev Docs](#using-the-framework-sneakykittygamedev-docs) - [SKG Shooter Framework | SneakyKittyGameDev Docs](#skg-shooter-framework-sneakykittygamedev-docs) - [Data Assets | SneakyKittyGameDev Docs](#data-assets-sneakykittygamedev-docs) - [Developer Settings | SneakyKittyGameDev Docs](#developer-settings-sneakykittygamedev-docs) - [Multiplayer | SneakyKittyGameDev Docs](#multiplayer-sneakykittygamedev-docs) - [Setting up a firearm | SneakyKittyGameDev Docs](#setting-up-a-firearm-sneakykittygamedev-docs) - [Gameplay tag attachment compatibility | SneakyKittyGameDev Docs](#gameplay-tag-attachment-compatibility-sneakykittygamedev-docs) - [Setting up a red dot | SneakyKittyGameDev Docs](#setting-up-a-red-dot-sneakykittygamedev-docs) - [Setting up a handguard and forward grip | SneakyKittyGameDev Docs](#setting-up-a-handguard-and-forward-grip-sneakykittygamedev-docs) - [Setting up a magnified optic | SneakyKittyGameDev Docs](#setting-up-a-magnified-optic-sneakykittygamedev-docs) - [Setting up a muzzle device | SneakyKittyGameDev Docs](#setting-up-a-muzzle-device-sneakykittygamedev-docs) - [Setting up a light and laser | SneakyKittyGameDev Docs](#setting-up-a-light-and-laser-sneakykittygamedev-docs) - [Creating a custom pose | SneakyKittyGameDev Docs](#creating-a-custom-pose-sneakykittygamedev-docs) - [Troubleshooting | SneakyKittyGameDev Docs](#troubleshooting-sneakykittygamedev-docs) - [Setting up a pawn | SneakyKittyGameDev Docs](#setting-up-a-pawn-sneakykittygamedev-docs) - [Updating to 2.0.0 | SneakyKittyGameDev Docs](#updating-to-2-0-0-sneakykittygamedev-docs) - [Setting up attachments | SneakyKittyGameDev Docs](#setting-up-attachments-sneakykittygamedev-docs) - [Setting up the animation blueprint | SneakyKittyGameDev Docs](#setting-up-the-animation-blueprint-sneakykittygamedev-docs) - [Setting up night vision | SneakyKittyGameDev Docs](#setting-up-night-vision-sneakykittygamedev-docs) - [Performing animations | SneakyKittyGameDev Docs](#performing-animations-sneakykittygamedev-docs) - [Holding other items | SneakyKittyGameDev Docs](#holding-other-items-sneakykittygamedev-docs) - [SKGAttachmentComponent | SneakyKittyGameDev Docs](#skgattachmentcomponent-sneakykittygamedev-docs) - [SKGAttachmentManagerComponent | SneakyKittyGameDev Docs](#skgattachmentmanagercomponent-sneakykittygamedev-docs) - [SKGCharacterMovementComponent | SneakyKittyGameDev Docs](#skgcharactermovementcomponent-sneakykittygamedev-docs) - [SKGFirearmAttachmentStatComponent | SneakyKittyGameDev Docs](#skgfirearmattachmentstatcomponent-sneakykittygamedev-docs) - [SKGShooterPawnComponent | SneakyKittyGameDev Docs](#skgshooterpawncomponent-sneakykittygamedev-docs) - [SKGProceduralAnimComponent | SneakyKittyGameDev Docs](#skgproceduralanimcomponent-sneakykittygamedev-docs) - [Physical Materials | SneakyKittyGameDev Docs](#physical-materials-sneakykittygamedev-docs) - [SKGInfraredHandlerComponent | SneakyKittyGameDev Docs](#skginfraredhandlercomponent-sneakykittygamedev-docs) - [SKGFirearmComponent | SneakyKittyGameDev Docs](#skgfirearmcomponent-sneakykittygamedev-docs) - [SKGLightLaserComponent | SneakyKittyGameDev Docs](#skglightlasercomponent-sneakykittygamedev-docs) - [SKGMuzzleComponent | SneakyKittyGameDev Docs](#skgmuzzlecomponent-sneakykittygamedev-docs) - [SKGNightVisionComponent | SneakyKittyGameDev Docs](#skgnightvisioncomponent-sneakykittygamedev-docs) - [SKGOffhandIKComponent | SneakyKittyGameDev Docs](#skgoffhandikcomponent-sneakykittygamedev-docs) - [SKGObjectTemperatureComponent | SneakyKittyGameDev Docs](#skgobjecttemperaturecomponent-sneakykittygamedev-docs) - [SKGOpticComponent | SneakyKittyGameDev Docs](#skgopticcomponent-sneakykittygamedev-docs) - [SKGOpticSceneCaptureComponent | SneakyKittyGameDev Docs](#skgopticscenecapturecomponent-sneakykittygamedev-docs) - [SKGStockComponent | SneakyKittyGameDev Docs](#skgstockcomponent-sneakykittygamedev-docs) - [SKGRangeFinderComponent | SneakyKittyGameDev Docs](#skgrangefindercomponent-sneakykittygamedev-docs) - [Projectiles | SneakyKittyGameDev Docs](#projectiles-sneakykittygamedev-docs) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) --- # Project Setup | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/project-setup.md) . The framework comes in two parts: the plugin, which holds all of the code, and the content in the example project. The example project's Content folder has two folders: * **SKGSFCore**: Required. The materials, meshes, anim layers, post process materials and other assets the system uses, such as MPC\_SKGSF, the optic and night vision materials, AnimLayer\_SKGSF\_Procedurals and the laser meshes. The framework doesn't work without it. * **SKGSFExampleContent**: Optional. The example project's own assets and logic shown in the demo, such as BP\_PlayerPawn, BP\_M4, the mannequin and its animations, and the timed course. It's a premade project to show everything working and to get you started. I don't recommend building your game on top of the example project. Keep it as a reference instead. Adding the framework to your project[](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/project-setup#adding-the-framework-to-your-project) ----------------------------------------------------------------------------------------------------------------------------------------------------------- 1. Install the plugin to your project's Plugins folder, next to your .uproject file, so it ends up in YourProject/Plugins/SKGShooterFramework. If the Plugins folder doesn't exist, create it. 2. Open the example project, right-click the SKGSFCore folder in the Content Browser and pick Migrate (make sure only items in the SKGSFCore folder are checked). Pick your project's Content folder as the destination. Migrate keeps the folder structure, so everything inside it keeps working. 3. Open your project and set up the [Developer Settings](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings) . Project settings aren't copied when you migrate content, so the mesh forward axis, collision channels and MPC\_SKGSF need setting in your project. 4. Set Custom Depth-Stencil Pass to Enabled with Stencil in Project Settings > Engine > Rendering, under Postprocessing. Optics, night vision and thermal use custom stencil values. Then follow [Setting up a pawn](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-pawn) . [PreviousSKG Shooter Framework](https://sneakykittygamedev.gitbook.io/skgsfdocs) [NextUsing the framework](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/using-the-framework) Last updated 5 days ago Was this helpful? --- # Using the framework | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/using-the-framework.md) . Use the [SKGShooterPawnComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent) as your way into the rest of the framework. It keeps track of what the player is holding and some of its components. For example, if you are holding a firearm, the [SKGShooterPawnComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent) holds the [SKGFirearmComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent) from the held actor so you can access it. The pawn component[](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/using-the-framework#the-pawn-component) ----------------------------------------------------------------------------------------------------------------------------- Aiming, leaning, free look, poses and recoil are called here. These getters return what's in use right now: * **GetHeldActor**: What the player is holding. * **GetCurrentFirearmComponent**: The held firearm's [SKGFirearmComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent) . None when the held actor isn't a firearm. * **GetCurrentProceduralAnimComponent**: The [SKGProceduralAnimComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent) being aimed with. * **GetCurrentOpticComponent**: The [SKGOpticComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent) being aimed through. * **GetCurrentLightLaserComponents**: Every [SKGLightLaserComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skglightlasercomponent) on what the player is holding. These work for anything held, such as a flashlight. With a firearm they come from its [SKGFirearmComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent) . They return None when nothing is in use, such as with no optic attached, so check them with Is Valid. The firearm component[](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/using-the-framework#the-firearm-component) ----------------------------------------------------------------------------------------------------------------------------------- For more control over a firearm and its accessories, get its [SKGFirearmComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent) with `GetCurrentFirearmComponent`. It holds every SKG component on the firearm and its attachments, such as, but not limited to: * **Lights and lasers**: `ToggleAllLights` and `ToggleAllLasers` switch every device at once. Use `GetLightLaserComponents` to pick a specific one. * **Optics**: `GetCurrentOpticComponent` to zoom with `ZoomIn` or change the reticle with `IncreaseReticleBrightness`. `CycleAimingDevice` switches to the next optic. * **Muzzle**: `GetCurrentMuzzleComponent`, and `GetMuzzleProjectileTransform` for where to spawn the bullet. * **Offhand**: `GetCurrentOffhandIKComponent`, such as the forward grip being held. * **Stock**: `GetCurrentStockComponent`. See [SKGFirearmComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent#functions) for the full list. [PreviousProject Setup](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/project-setup) [NextDeveloper Settings](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings) Last updated 6 days ago Was this helpful? --- # SKG Shooter Framework | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/readme.md) . The SKG Shooter Framework is a set of components for building first and third person shooters in Unreal Engine. Add the components to your pawn, firearms and attachments, and they handle aiming, sway, recoil, poses, attachments, optics, lights and lasers, night vision, thermal and more. Everything is replicated for multiplayer. It isn't limited to firearms. Anything you hold can use the procedural animation, such as a flashlight, a rock, or your character's own fists. These docs are for version 2.0.0. Getting started[](https://sneakykittygamedev.gitbook.io/skgsfdocs#getting-started) ----------------------------------------------------------------------------------- Start with [Project Setup](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/project-setup) to add the framework to your project. The example project has everything in these docs set up so feel free to use it as a reference. Follow these in order: 1. [Project Setup](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/project-setup) 2. [Developer Settings](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings) : your mesh forward axis, collision channels and material parameter collection. 3. [Setting up a pawn](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-pawn) 4. [Setting up the animation blueprint](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-the-animation-blueprint) 5. [Setting up a firearm](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-firearm) 6. [Setting up attachments](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-attachments) , if you use the attachment system. Then use the guides for what your game needs: * Optics: [Setting up a red dot](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-red-dot) and [Setting up a magnified optic](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-magnified-optic) * Attachments: [Setting up a handguard and forward grip](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-handguard-and-forward-grip) , [Setting up a muzzle device](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-muzzle-device) , [Setting up a light and laser](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-light-and-laser) and [Gameplay tag attachment compatibility](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/gameplay-tag-attachment-compatibility) * [Setting up night vision](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-night-vision) * [Holding other items](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/holding-other-items) , such as a flashlight * Animation: [Creating a custom pose](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/creating-a-custom-pose) and [Performing animations](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/performing-animations) Components[](https://sneakykittygamedev.gitbook.io/skgsfdocs#components) ------------------------------------------------------------------------- Every component has its own page in the sidebar, with each of its settings, functions and events. [Using the framework](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/using-the-framework) covers how they connect and which one to call. Other[](https://sneakykittygamedev.gitbook.io/skgsfdocs#other) --------------------------------------------------------------- * [Data Assets](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/data-assets) : Optional templates for sharing settings between Blueprints. * [Multiplayer](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/multiplayer) : What's sent to other players and what stays local. * [Projectiles](https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/projectiles) : An optional, simple projectile system for firing bullets. * [Physical Materials](https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/physical-materials) : Optional surface effects for footsteps and bullet impacts. * [Troubleshooting](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/troubleshooting) : Common problems and what to check. * [Updating to 2.0.0](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/updating-to-2-0-0) : For projects that used the framework before 2.0.0. Modules[](https://sneakykittygamedev.gitbook.io/skgsfdocs#modules) ------------------------------------------------------------------- The plugin is split into modules. If you use the framework from C++, add the ones you need to your Build.cs. Module Contains SKGShooterFramework [SKGShooterPawnComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent) , [SKGFirearmComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent) , [SKGCharacterMovementComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgcharactermovementcomponent) and the anim instance SKGShooterFrameworkCore The SKG Shooter Framework developer settings and the infrared world subsystem used by the other modules SKGProceduralAnim [SKGProceduralAnimComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent) and [SKGOffhandIKComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgoffhandikcomponent) SKGAttachment [SKGAttachmentComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentcomponent) and [SKGAttachmentManagerComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentmanagercomponent) SKGOptic [SKGOpticComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent) and [SKGOpticSceneCaptureComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticscenecapturecomponent) SKGMuzzle [SKGMuzzleComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgmuzzlecomponent) SKGLightLaser [SKGLightLaserComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skglightlasercomponent) and [SKGInfraredHandlerComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skginfraredhandlercomponent) SKGNightVision [SKGNightVisionComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgnightvisioncomponent) SKGTemperature [SKGObjectTemperatureComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgobjecttemperaturecomponent) SKGRangeFinder [SKGRangeFinderComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgrangefindercomponent) SKGStock [SKGStockComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgstockcomponent) SKGStats [SKGFirearmAttachmentStatComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmattachmentstatcomponent) SKGProjectile The projectile system, see [Projectiles](https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/projectiles) SKGPhysicalMaterialModule SKGPhysicalMaterial for surface impact and footstep effects, see [Physical Materials](https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/physical-materials) SKGAnimGraphNodes The Gameplay Tag Blend anim graph node SKGShooterFrameworkActors SKGBaseActor, an actor with gameplay tags, and other base actor classes SKGShooterFrameworkEditor Editor tools SKGOptional An example character class. Can be ignored Support[](https://sneakykittygamedev.gitbook.io/skgsfdocs#support) ------------------------------------------------------------------- Ask questions and get help on the [Discord](https://discord.gg/W5g6pZXfjh) . [NextProject Setup](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/project-setup) Last updated 6 days ago Was this helpful? --- # Data Assets | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/data-assets.md) . Every settings group on a component, such as the optic's Reticle Settings or the procedural anim's Recoil Settings, has a Data Asset field next to it. Leave it empty and the values set on the component are used. Set it and the whole group comes from the data asset instead. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-197486c4c487c099e57cfdd82bedb4dbafc17ada%252Fdata-asset-set.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=79c7e115cf3fb8863d2abbc3a47668ea&sv=3) An SKGProceduralAnim component with DA\_ProceduralAnimInitSettings\_Firearm set, so Initialization Settings is greyed out Data assets work as templates. Use one when several Blueprints should share the same settings, such as one recoil data asset for every M4 variant, or the same reticle settings on several optics. Change the data asset and every Blueprint using it picks up the change without having to make the change on each blueprint. These are entirely optional. Making a data asset[](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/data-assets#making-a-data-asset) ----------------------------------------------------------------------------------------------------------------------- 1. In the Content Browser, right-click and pick SKG > Data Assets. 2. Pick the category, then the settings group, from the table below. 3. Fill in the values. They're the same settings as on the component, so the component pages explain each one. 4. Set it in the group's Data Asset field on the component. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-86729c7966152cdfc22aab70f258d9f37dfb6476%252Fcreate-menu.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=5c08ef656687b631958cb3eed9f5e1d7&sv=3) Right-click > SKG > Data Assets > Light Laser in the Content Browser The example project has some to start from in SKGSFCore/Data/ExampleProceduralSettings, such as DA\_RecoilSettings\_Example, and the poses in SKGSFExampleContent/Data/ProceduralSettings/Poses. Which data asset to make[](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/data-assets#which-data-asset-to-make) --------------------------------------------------------------------------------------------------------------------------------- Component Settings group SKG > Data Assets menu [SKGOpticComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent) Initialization Settings Optic > Optic Initialization Settings Reticle Settings Optic > Optic Reticle Settings Optic Zero Settings Optic > Optic Zero Settings [SKGProceduralAnimComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent) Initialization Settings ProceduralAnim > Procedural Anim Initialization Settings Aiming Settings ProceduralAnim > Aiming Settings Procedural Offsets ProceduralAnim > Procedural Offsets Settings Cycle Aiming Point Settings ProceduralAnim > Cycle Aiming Point Settings Movement Sway Settings ProceduralAnim > Movement Sway Settings Movement Lag Settings ProceduralAnim > Movement Lag Settings Rotation Lag Settings ProceduralAnim > Rotation Lag Settings Deadzone Settings ProceduralAnim > Deadzone Settings Recoil Settings ProceduralAnim > Recoil Settings Pose Settings ProceduralAnim > Procedural Pose Settings, one per pose [SKGOffhandIKComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgoffhandikcomponent) Initialization Settings OffhandIK > OffhandIK Initialization Settings Offhand IKSettings OffhandIK > OffhandIK Settings [SKGFirearmComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent) Firearm Stat Settings Stats > Firearm Stat Settings Firearm Collision Settings Firearm > Firearm Collision Settings [SKGFirearmAttachmentStatComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmattachmentstatcomponent) Attachment Stats Stats > Firearm Attachment Stat Settings [SKGMuzzleComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgmuzzlecomponent) Initialization Settings Muzzle > Muzzle Initialize Settings Muzzle Settings Muzzle > Muzzle Settings [SKGLightLaserComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skglightlasercomponent) Initialization Settings Light Laser > Light Laser Initialize Settings Light Laser Settings Light Laser > Light Laser Settings [SKGRangeFinderComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgrangefindercomponent) Range Finder Settings Range Finder > Range Finder Settings [SKGObjectTemperatureComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgobjecttemperaturecomponent) Temperature Settings Temperature > Object Temperature Settings [SKGNightVisionComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgnightvisioncomponent) Tube Settings Night Vision > Night Vision Tube Settings Housing Settings Night Vision > Night Vision Housing Settings Attachment > Attachment Compatibility Settings makes the data assets for an attachment slot's Compatible Attachments, covered on the [SKGAttachmentComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentcomponent) page. While playing[](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/data-assets#while-playing) ----------------------------------------------------------------------------------------------------------- The [SKGProceduralAnimComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent) can swap a group for another data asset while playing and swap back, such as heavier sway while injured. See its Data Assets functions. Other components use their data assets when they initialize, so set the data asset before then, or call their Initialize function again afterward. [PreviousDeveloper Settings](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings) [NextMultiplayer](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/multiplayer) Last updated 6 days ago Was this helpful? --- # Developer Settings | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings.md) . The framework's project wide settings are in Project Settings > Plugins, split over four pages: SKG Shooter Framework, SKG Shooter Framework Attachment System, SKG Shooter Framework Optic Settings, and SKG Shooter Framework Temperature Settings. They're saved to DefaultGame.ini. The example project has all of them set up, so compare against it if something isn't working. SKG Shooter Framework[](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings#skg-shooter-framework) ---------------------------------------------------------------------------------------------------------------------------------- ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-8c2ef7dab06691e19993eeda98af1873a06013fb%252Fmesh-forward-axis.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=ceac8c99960eb8cc339111de67c5fb6b&sv=3) The SKG Shooter Framework settings in the example project ### Procedural Animation[](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings#procedural-animation) * **Mesh Forward Axis**: Which way every firearm and attachment mesh in your project faces, X Forward or Y Forward. Pick the one your assets use and keep it the same for all of them. The example's assets are Y Forward. Procedural settings and curves are always entered as X forward, Y right and Z up, so they work the same with either. See [Setting up a firearm](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-firearm) . ### Firearm Collision[](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings#firearm-collision) * **Firearm Collision Channel**: The trace channel used to push the firearm back when it runs into something, such as a wall. I recommend making a channel just for this in Project Settings > Engine > Collision, like the example's FirearmCollision trace channel with a Default Response of Block. Set anything the firearm shouldn't bump into to ignore it. ### Light Laser[](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings#light-laser) * **Laser Collision Channel**: The trace channel lasers stop at. The laser dot is placed where it hits. The example uses its own Laser trace channel with a Default Response of Block. ### Range Finder[](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings#range-finder) * **Range Finder Collision Channel**: The trace channel the [SKGRangeFinderComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgrangefindercomponent) measures with. The example uses the Laser channel for this too. ### Night Vision[](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings#night-vision) * **SKGSF Material Parameter Collection**: Set to MPC\_SKGSF from SKGSFCore/Materials. The framework writes night vision, infrared, stencil and mesh forward axis values to it, and the optic, night vision and laser materials read them. ### Camera[](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings#camera) * **Allow SKGCamera FOVChanges**: Lets the [SKGShooterPawnComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent) zoom the camera while aiming, by the aiming settings' Camera Zoom Percentage or to the optic's magnification for magnified optics in Normal mode. Turn it off only if you change the camera's field of view yourself, since Normal mode optics won't zoom without it. * **Camera FOVInterpolation Speed**: How fast the field of view changes, in degrees per second. 100 in the example. ### Custom Primitive Index[](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings#custom-primitive-index) Where values are written in a mesh's custom primitive data. The [SKGLightLaserComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skglightlasercomponent) writes the laser's color, brightness, and infrared flag at these indices, and the [SKGMuzzleComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgmuzzlecomponent) writes the muzzle temperature. Your own Blueprints and C++ can get them with the matching Get function from the developer settings. The materials don't read these settings, so if you change one, change the matching parameter's index in your materials too. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-4e23a86508bd36e7d25a97b7c556983ee0202c0b%252Fcustom-primitive-index.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=5bc92d82daaeec2f549915dce9730f50&sv=3) The Custom Primitive Index settings * **Laser Color Custom Primitive Index**: 0. The laser color in M\_Laser\_Master and M\_LaserDot\_Master. `GetLaserColorCustomPrimitiveIndex`. * **Laser Brightness Custom Primitive Index**: 4. The laser brightness in the same materials. `GetLaserBrightnessCustomPrimitiveIndex`. * **Is Infrared Custom Primitive Index**: 5. Whether the mesh is infrared, read by MF\_InfraredMask in the laser materials, M\_LightBlinder and M\_EmissiveMaster. `GetIsInfraredCustomPrimitiveIndex`. * **Muzzle Temp Custom Primitive Index**: 0. The muzzle temperature in M\_HeatUp\_Master. `GetMuzzleTempCustomPrimitiveIndex`. SKG Shooter Framework Attachment System[](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings#skg-shooter-framework-attachment-system) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- Only used by the gameplay tag compatibility system, covered in [Gameplay tag attachment compatibility](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/gameplay-tag-attachment-compatibility) . * **Asset Types**: The primary asset types `GetCompatibleAttachmentsFromPrimaryAssets` searches. * **Slot Compatibility Table List**: The data tables that list which attachment tags each slot tag accepts, such as DT\_TagAttachmentCompatibilitySystem. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-7efe8c5ba0f8890975cbbb1b9eb401ad77ab59f9%252Fdeveloper-settings.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=f0c37b268fcd0f3568c8b273aa8490ea&sv=3) The attachment system settings with DT\_TagAttachmentCompatibilitySystem in Slot Compatibility Table List SKG Shooter Framework Optic Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings#skg-shooter-framework-optic-settings) ---------------------------------------------------------------------------------------------------------------------------------------------------------------- ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-d1cebbae0da365ed35c54ae1019491c403872225%252Foptic-settings.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=7a7b10722a9b164b394b0dca6952a408&sv=3) The optic settings in the example project * **Scene Capture GIMethod** / **Scene Capture Reflection Method**: The global illumination and reflections used for the zoomed view of magnified optics in Picture in Picture. Lumen matches the player's view but costs more. None is much cheaper but the zoomed view can look darker or flatter than the scene around it. * **Digital Scene Capture GIMethod** / **Digital Scene Capture Reflection Method**: The same for digital optics such as thermal scopes. None by default, since a digital screen doesn't need to match the scene exactly. * **Eyebox Eye Pupil Radius**: The size of the player's eye in cm, 0.15 by default. The scope's image darkens as your eye moves off its exit pupil, and a bigger eye pupil makes that fade wider and more forgiving. * **Eyebox Exit Pupil Tolerance**: Extra radius in cm added to every optic's exit pupil, making every scope's eyebox more forgiving without changing their specs. 0 by default. * **SharedViewFamily**: Settings that render magnified optics as part of the player's own view for better performance. Covered in [Setting up a magnified optic](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-magnified-optic#shared-view-family) . SKG Shooter Framework Temperature Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings#skg-shooter-framework-temperature-settings) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- * **Temperature MPC** > **Temperature Material Parameter Collection**: Set to MPC\_SKGSF. The [SKGObjectTemperatureComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgobjecttemperaturecomponent) reads its thermal stencil range from it, so hot objects show up in thermal optics. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-c0e65cd60ca47f95668f45db587aa3ac65e9d60d%252Ftemperature-settings.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=4b991b5c445d9c6201f567f4b1f12666&sv=3) The temperature settings with MPC\_SKGSF [PreviousUsing the framework](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/using-the-framework) [NextData Assets](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/data-assets) Last updated 5 days ago Was this helpful? --- # Multiplayer | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/multiplayer.md) . The framework is built for multiplayer. This page sums up in short what is sent to other players and what each machine handles on its own. It does not cover everything but it should give you an idea. Requirements[](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/multiplayer#requirements) --------------------------------------------------------------------------------------------------------- * Turn on Replicates on your firearms, attachments, and devices such as night vision goggles. * Call `SetHeldActor` on the server with whatever you are holding that uses the SKGSF system. Seen by every player[](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/multiplayer#seen-by-every-player) ------------------------------------------------------------------------------------------------------------------------- These can be called on the client. They happen right away for that player and are sent to the server so everyone sees them: * Aiming, leaning, free look, poses, and switching hands * Cycling which aiming device you aim through * Light and laser modes, night vision illuminator, and infrared mode on SKGInfraredHandler lights * Folding the stock * Adding and removing attachments. They're spawned on the server, and the owner can change them from the client if Allow Client Side Modification is enabled on the [SKGAttachmentComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentcomponent#attachment) . Object temperature is set on the server and sent to everyone. Other players see poses with their Third Person Curve. Local only[](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/multiplayer#local-only) ----------------------------------------------------------------------------------------------------- Each machine handles these on its own: * Optics: the reticle, brightness, zoom, zero and the Picture in Picture image * The night vision image, tubes and gain, and `EnableInfraredMode` * Muzzle temperature, from that machine's `ShotPerformed` calls * [Projectiles](https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/projectiles) and the range finder * Recoil, covered below Recoil[](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/multiplayer#recoil) --------------------------------------------------------------------------------------------- Recoil only plays on the machine that calls `PerformProceduralRecoil` on the [SKGShooterPawnComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent) . Call it on the shooting player's machine for every shot. For other players to see that player's firearm kick, call it on their machines too, in the same place you play that player's shot for them. This could be when you play the firing sound or animation. The camera kick only applies to the shooting player. The example's BP\_PlayerPawn calls it when its firearm sends the Events.Firearm.Fire owner event. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-2e414fdc24b5199ea8aa363d88988d8c3c8b7ccb%252Frecoil.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=a972e7e9e31425e4bfe8f629a2948822&sv=3) BP\_PlayerPawn plays the recoil when its firearm sends the Events.Firearm.Fire owner event [PreviousData Assets](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/data-assets) [NextTroubleshooting](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/troubleshooting) Last updated 6 days ago Was this helpful? --- # Setting up a firearm | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-firearm.md) . This guide builds a firearm you can hold, aim and shoot, like the example's BP\_M4 or BP\_BoltGun. Both are children of BP\_Firearm, which holds the components and shooting logic the example's firearms share. Optics, handguards, muzzle devices, and other attachments have their own guides. These were built to be very simple just using blueprints and manually adding components. For reference, in my personal projects and at work, these are all loaded async and constructed entirely from data. Set up the pawn and its animation blueprint first, as covered in [Setting up a pawn](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-pawn) and [Setting up the animation blueprint](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-the-animation-blueprint) . 1\. Mesh[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-firearm#id-1.-mesh) --------------------------------------------------------------------------------------------------------- The firearm can be a static or skeletal mesh. Every firearm and attachment mesh in your project has to face the same way with either Y being the forward axis or X being the forward axis. It does not matter which forward direction you choose as long as it is consistent across your firearms and attachments. You can set the Mesh Forward Axis you are using in Project Settings > Plugins > SKG Shooter Framework to the direction your assets are. In the example project, the assets are Y forward. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-2847865a24c0187a6367f16a930af80eb606d2a8%252Fforward-axis.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=7dd5303417b694de7cb7174135f6e91a&sv=3) SK\_BoltGun is Y forward: the green Y arrow points down the barrel and the blue Z arrow points up, with the pivot at the grip ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-8c2ef7dab06691e19993eeda98af1873a06013fb%252Fmesh-forward-axis.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=ceac8c99960eb8cc339111de67c5fb6b&sv=3) Mesh Forward Axis and the other SKG Shooter Framework settings 2\. Sockets[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-firearm#id-2.-sockets) --------------------------------------------------------------------------------------------------------------- Add these sockets to the firearm's mesh. The names are the components' defaults, so you won't need to change them. Socket Where Used by S\_Aim In line with the sights, where the eye looks through them. It needs no rotation. [SKGProceduralAnimComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent) S\_Muzzle Just past the end of the barrel, with its X axis (red arrow) pointing out of the barrel. If the firearm has no barrel (such as the example M4, this is not needed). [SKGMuzzleComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgmuzzlecomponent) S\_LeftHandIK Where the left wrist sits when holding the firearm. It's the hand bone, not the palm. [SKGOffhandIKComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgoffhandikcomponent) S\_RightHandIK Optional. The same for the right hand when left-handed. [SKGOffhandIKComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgoffhandikcomponent) S\_PointAimRightHandDominant / S\_PointAimLeftHandDominant Optional. Where to aim from when point aiming, such as a canted aim, right- and left-handed. Set them in the SKGProceduralAnim component's point aim socket names. [SKGProceduralAnimComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent) A firearm with attachments, like the M4, also has a socket for each attachment slot, such as S\_Attachment\_Barrel. Those are covered in the attachment guide. An attachment with its own socket, such as a barrel's S\_Muzzle or a handguard's S\_LeftHandIK, takes over from the firearm's while it's attached. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-107c09d646f9fa05587a2d2bbc02cc964a22ed68%252Fsockets.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=74f6cdf7d9ed4219b405db66787507a2&sv=3) SK\_M4's sockets, with its attachment slots and the barrel and pistol grip previewed 3\. Firearm Blueprint[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-firearm#id-3.-firearm-blueprint) ----------------------------------------------------------------------------------------------------------------------------------- Create an Actor Blueprint and turn on Replicates for multiplayer. Add the mesh, then these components. Each one finds the mesh by name, so set its mesh name to your mesh component's name which is FirearmMeshComponent in the example. 1. **SKGFirearm**: Set Firearm Mesh Component Name. Leave Attachment Manager Component Name as None until you add attachments. See [SKGFirearmComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent) for firearm collision and stats. 2. **SKGProceduralAnim**: Set Procedural Mesh Name. This is where aiming, sway, lag, recoil and poses are set up. The example's settings in SKGSFCore/Data/ExampleProceduralSettings are a good start. See [SKGProceduralAnimComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent) . 3. **SKGMuzzle**: Set Muzzle Mesh Component Name. See [SKGMuzzleComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgmuzzlecomponent) . 4. **SKGOffhandIK**: Only if the offhand holds the firearm itself, like BP\_BoltGun. Set Offhand IKMesh Name and pick the left hand pose. A firearm with a handguard attachment, like the M4, gets it from the handguard instead. See [SKGOffhandIKComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgoffhandikcomponent) . ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-d45477a2fa29af6218055f02ea420c963a166fd5%252Fcomponents.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=2e1bb95942d2aa59cdde977a44bc0b71&sv=3) BP\_M4's components. The ones with Edit in Blueprint come from BP\_Firearm, and the SKGAttachment ones are its attachment slots. 4\. Holding it[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-firearm#id-4.-holding-it) --------------------------------------------------------------------------------------------------------------------- Spawn the firearm, call `SetHeldActor` on the pawn's SKGShooterPawn component on the server, and attach the firearm to the pawn's mesh at ik\_hand\_gun. See the Holding something section in [Setting up a pawn](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-pawn) . 5\. Shooting[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-firearm#id-5.-shooting) ----------------------------------------------------------------------------------------------------------------- The framework doesn't decide when to shoot. Your own logic, such as the example's BP\_Firearm, does. For each shot: 1. Fire the bullet from `GetMuzzleProjectileTransform` on the SKGFirearm component, with the [projectile system](https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/projectiles) or your own. 2. Call `ShotPerformed` on the SKGFirearm component, for muzzle temperature if you wish to use it. 3. Call `PerformProceduralRecoil` on the pawn's SKGShooterPawn component on every player that should see the recoil as it is handled locally. See [Recoil](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/multiplayer#recoil) on the Multiplayer page. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-3113e988ac744803133d0125b74fd3cf6708deac%252Ffire-shot.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=0ecdeca1d67b7d91371e6d4f0951f845&sv=3) BP\_Firearm's FireShot fires the projectile, plays the fire animation, calls Shot Performed and plays the muzzle effects ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-2e414fdc24b5199ea8aa363d88988d8c3c8b7ccb%252Frecoil.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=a972e7e9e31425e4bfe8f629a2948822&sv=3) BP\_PlayerPawn plays the recoil when its firearm sends the Events.Firearm.Fire owner event [PreviousSetting up the animation blueprint](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-the-animation-blueprint) [NextSetting up attachments](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-attachments) Last updated 6 days ago Was this helpful? --- # Gameplay tag attachment compatibility | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/gameplay-tag-attachment-compatibility.md) . Instead of listing every attachment that fits a slot in Compatible Attachments, slots and attachments can use gameplay tags. Each slot has a slot tag, each attachment has its own tags, and a table says which attachment tags each slot accepts. A new Picatinny optic then only needs the Attachment.Picatinny.Optic tag to fit every Picatinny optic slot in your game, instead of being added to every slot's list. This guide puts the example's holo sight, BP\_Optic\_HoloSight, on the M4's optic slot this way. 1\. Gameplay tags[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/gameplay-tag-attachment-compatibility#id-1.-gameplay-tags) -------------------------------------------------------------------------------------------------------------------------------------------- Make two sets of tags, one for slots and one for attachments. The example keeps them in two data tables in SKGSFExampleContent/Data/DataTables/GameplayTags/AttachmentSystem: * DT\_AttachmentSlots, such as AttachmentSlot.Picatinny.Optic and AttachmentSlot.M4.Barrel. * DT\_Attachments, such as Attachment.Picatinny.Optic and Attachment.M4.Barrel. Gameplay tags are a hierarchy, so a slot that accepts Attachment.Picatinny accepts anything under it, such as Attachment.Picatinny.Optic and Attachment.Picatinny.Foregrip. The design was based around the idea where you make the tags around what physically fits, such as the rail type, rather than around each attachment. To make your own tables, create a Data Table with the GameplayTagTableRow structure, then add it to Gameplay Tag Table List in Project Settings > Gameplay Tags. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-3787fb49b48b47390576030e8649b671fbc212bc%252Ftag-tables.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=2deaa4d1d2434700fef98b5b3fa18d5a&sv=3) DT\_AttachmentSlots and DT\_Attachments with the example's slot and attachment tags 2\. Compatibility table[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/gameplay-tag-attachment-compatibility#id-2.-compatibility-table) -------------------------------------------------------------------------------------------------------------------------------------------------------- Create a Data Table with the SKGAttachmentSlotCompatibility structure, like the example's DT\_TagAttachmentCompatibilitySystem. Add a row for each slot tag: * **Slot Tag**: The slot this row is for, such as AttachmentSlot.Picatinny.Optic. * **Query**: Which attachment tags fit this slot, edited in the Tag Query Editor. The example's AttachmentSlot.Picatinny.Optic row uses All Expressions Match with two expressions: Any Tags Match Attachment.Picatinny, and No Tags Match Attachment.Picatinny.Foregrip, Attachment.Picatinny.LightLaser and Attachment.Picatinny.OffsetPicatinny. Every Picatinny attachment fits except grips, lights and offset rails, so optics and optic mounts both go on the M4's optic rail. A slot whose tag has no row in any table accepts nothing. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-f6e157a18fb0c981dfcdbdc25456dfe3e93bfb28%252Fcompatibility-table.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=bb7500cb3da44dbb2d5a9d9a8f7de57a&sv=3) DT\_TagAttachmentCompatibilitySystem with the AttachmentSlot.Picatinny.Optic row's query open in the Tag Query Editor Then add the table to Slot Compatibility Table List in Project Settings > Plugins > SKG Shooter Framework Attachment System. You can add more than one table, such as one per firearm family. Asset Types is only used by `GetCompatibleAttachmentsFromPrimaryAssets` and can be left alone. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-7efe8c5ba0f8890975cbbb1b9eb401ad77ab59f9%252Fdeveloper-settings.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=f0c37b268fcd0f3568c8b273aa8490ea&sv=3) The attachment system settings with DT\_TagAttachmentCompatibilitySystem in Slot Compatibility Table List 3\. Attachments[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/gameplay-tag-attachment-compatibility#id-3.-attachments) ---------------------------------------------------------------------------------------------------------------------------------------- An attachment needs to implement the gameplay tags interface so the slot can read its tags. Blueprints can't implement it themselves, so reparent the attachment's Blueprint to SKGBaseActor in Class Settings > Parent Class. Your own C++ actor that implements IGameplayTagAssetInterface works too. Then add the attachment's tags to Gameplay Tags in its Class Defaults, such as Attachment.Picatinny.Optic on the holo sight. 4\. Slots[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/gameplay-tag-attachment-compatibility#id-4.-slots) ---------------------------------------------------------------------------------------------------------------------------- On the slot's [SKGAttachment](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentcomponent) component, under Compatibility: * Turn off Use Legacy Attachment System. * Under GameplayTag, set Slot Tag to the slot's tag, such as AttachmentSlot.Picatinny.Optic on the M4's SKGAttachment\_Optic. Leave Slot Compatibility Override empty. It's for a one-off slot that isn't worth a table row: leave Slot Tag empty and fill in the override's own Slot Tag and Query instead. The override's Slot Tag only has to be set for the override to be used, and its Query is checked like a table row's. With both empty, the slot accepts any attachment that has the gameplay tags interface. An attachment without the interface never fits a slot using gameplay tags and an error is logged. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-17b7bd5005126987b9ce58cf562241f096f4510c%252Fslot-settings.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=07e5acaa0b23176cd8b54e6bf5640fd5&sv=3) SKGAttachment\_Optic with Use Legacy Attachment System off, Slot Tag set to AttachmentSlot.Picatinny.Optic and Slot Compatibility Override left empty Finding what fits[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/gameplay-tag-attachment-compatibility#finding-what-fits) ------------------------------------------------------------------------------------------------------------------------------------------ With gameplay tags the slot has no list of attachments, and `GetCompatibleAttachments` only reads Compatible Attachments. To show what fits a slot, such as in a customization menu, check each of your attachments with `IsAttachmentClassCompatible` on the slot. `GetAttachmentComponentWithSlotTag` on the [SKGAttachmentManagerComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentmanagercomponent) finds a slot by its Slot Tag. [PreviousSetting up attachments](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-attachments) [NextSetting up a red dot](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-red-dot) Last updated 6 days ago Was this helpful? --- # Setting up a red dot | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-red-dot.md) . This guide sets up a non-magnified optic such as a red dot or holographic sight just like the example's BP\_Optic\_HoloSight and BP\_Optic\_MicroDot. Magnified optics have their own guide. An optic is an attachment, but you can also hold optics in your hand and aim with them procedurally all the same. 1\. Mesh[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-red-dot#id-1.-mesh) --------------------------------------------------------------------------------------------------------- 1. I recommend having your own plane for the reticle so you can have glass on each side of the reticle. Make note of which material index this plane is on so the system can assign the reticle material to the correct material index. 2. Add an S\_Aim socket in the middle of the sight window, where the eye looks through. It needs no rotation. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-f055ab937618db5e978f0fd72f5a3efce3098687%252Freticle-index-holo.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=0c53ffb6f21ffff1e7c2e05bb87306e2&sv=3) Reticle material slot on the holographic sight ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-3a28d53d8a16498a12643d59549517b449423bfc%252Faim-socket.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=356e6298cab34a77d9717c6247caf424&sv=3) The S\_Aim socket on the holo sight, placed in the sight window 2\. Optic Blueprint[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-red-dot#id-2.-optic-blueprint) ------------------------------------------------------------------------------------------------------------------------------- Create an Actor Blueprint and turn on Replicates for multiplayer. Add the optic's mesh, then these two components (SKGOptic is optional if you do not wish to alter the reticle at runtime). ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-7523a87e36d4d82935854ed85c1560bbd32621b2%252Fcomponents.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=d24163ba6f27337dc8455c1f9bd751bd&sv=3) BP\_Optic\_HoloSight's components: its mesh, SKGOptic and SKGProceduralAnim ### SKGOptic[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-red-dot#skgoptic) This component is optional. If you do not need the ability to change reticles or any feature that this component offers, you can simply not add it. Under Initialization Settings: * Set Optic Mesh Name to the mesh (StaticMesh in this case). Set Optic Reticle Mesh Name to the same mesh unless the reticle is on a separate mesh as you will see in the magnified optic example. * Set Reticle Distortion Type to Planar if you want reticle distortion. * Leave Is Magnified off. Under Reticle Settings: * Set Reticle Material Index to the reticle's material slot, 1 on the holographic sight. * Set Reticle Material to M\_Reticle\_Master in SKGSFCore/Materials/Optic. Leave Normal Reticle Material empty, since it's only for magnified optics. * Add a Reticle Texture with its size and colors. Add more to switch between them with `CycleReticle`. The holographic sight in the example has two, a red and a green version. * Add the Reticle Brightness Settings, dimmest first, such as 25, 500 and 1000 in the example. * Optional: turn on Supports Night Vision and add Reticle Night Vision Brightness Settings for much dimmer levels for use through [night vision](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-night-vision) such as 0.02, 0.08 and 0.2. Every setting is explained on the [SKGOpticComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent) page. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-6f7ced8aeeeb052868602d590d4f777e0a9c9090%252Freticle-settings.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=405417204e0933cb5b1da10f1a657bcc&sv=3) The holographic sight's Reticle Settings ### SKGProceduralAnim[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-red-dot#skgproceduralanim) Set Procedural Mesh Name to the optic's mesh. Procedural Aim Socket Names already holds S\_Aim. On an attachment, only the Initialization Settings and a few Aiming Settings are used, such as Aiming Distance. Everything else comes from the firearm. See [SKGProceduralAnimComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent) . [PreviousGameplay tag attachment compatibility](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/gameplay-tag-attachment-compatibility) [NextSetting up a magnified optic](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-magnified-optic) Last updated 6 days ago Was this helpful? --- # Setting up a handguard and forward grip | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-handguard-and-forward-grip.md) . This guide sets up where the offhand holds the firearm such as the example's BP\_M4\_Handguard and BP\_Foregrip\_AFG. When you see Offhand, that is referring to either the left hand or the right hand. If you are in Right handed mode (default) then the Offhand is the left hand. Both use the [SKGOffhandIKComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgoffhandikcomponent) , which is optional. Without it, you can use a normal animation for holding the item. How the offhand picks what to hold[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-handguard-and-forward-grip#how-the-offhand-picks-what-to-hold) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ The firearm, handguard, and forward grip can each have an [SKGOffhandIKComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgoffhandikcomponent) . The [SKGFirearmComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent) uses the one with the highest Offhand IKTag: Forward Grip, then Handguard, then Firearm. On the M4 the hand holds the handguard until a forward grip is added, and goes back to the handguard when the grip is removed. A firearm with a built-in handguard puts its SKGOffhandIK on the firearm with the Firearm tag. 1\. Mesh[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-handguard-and-forward-grip#id-1.-mesh) ---------------------------------------------------------------------------------------------------------------------------- Add an S\_LeftHandIK socket where the left hand goes when right-handed. The socket is where the hand bone goes, so place it where the wrist should be when holding the grip. If the firearm can be used left-handed, also add S\_RightHandIK for the right hand. The handguard has both even though the example project does not use the switching hands feature, the forward grips only S\_LeftHandIK. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-e8a6d7a7d470df93999beda2373b7b7b3830694b%252Fhandguard-hand-socket.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=3293ecac02d95bd04b3127ee64767a00&sv=3) S\_LeftHandIK and S\_RightHandIK on the M4 handguard, off to the sides where the hand bones sit ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-00e64b0a2377ce4efb2436a9520871f569c6598f%252Fhand-socket.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=5182e0033a001b1ae179973f4078368f&sv=3) S\_LeftHandIK on the AFG, off to the side where the hand bone sits 2\. Grip pose[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-handguard-and-forward-grip#id-2.-grip-pose) -------------------------------------------------------------------------------------------------------------------------------------- Each SKGOffhandIK has a grip pose: a one frame animation that only poses the offhand. A vertical grip and an angled grip need different hand poses, so each grip has its own. The example's grip poses are AS\_Character\_AFGGrip, AS\_Character\_VerticalGrip and AS\_Character\_StubbyVerticalGrip in SKGSFExampleContent/Animation/MannyAnimations/GripPoses. The handguard uses the M4's idle animation, AS\_Character\_M4\_Idle, since the hand already holds the handguard in it. 3\. Handguard[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-handguard-and-forward-grip#id-3.-handguard) -------------------------------------------------------------------------------------------------------------------------------------- Add an SKGOffhandIK component to the handguard. Under Initialization Settings: * Set Offhand IKTag to Handguard. * Set Offhand IKMesh Name to the handguard's mesh (StaticMesh in the example project). * Left Hand IKSocket Name and Right Hand IKSocket Name already hold S\_LeftHandIK and S\_RightHandIK. Under Offhand IKSettings, set Left Hand IKPose to the grip pose, AS\_Character\_M4\_Idle on the M4. Set Right Hand IKPose too if the firearm can be used left-handed. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-69a770962f2faffd023b795bebc12bb6278a9715%252Fhandguard-offhand-ik.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=c8c26cc39b41455e9224a05df903b033&sv=3) BP\_M4\_Handguard's SKGOffhandIK settings The handguard's rail slots are covered in [Setting up attachments](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-attachments) . The forward grips go on its bottom rail. 4\. Forward grip[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-handguard-and-forward-grip#id-4.-forward-grip) -------------------------------------------------------------------------------------------------------------------------------------------- Create the forward grip as an attachment with its mesh, then add an SKGOffhandIK component. Under Initialization Settings: * Set Offhand IKTag to Forward Grip. * Set Offhand IKMesh Name to the grip's mesh (StaticMesh). Under Offhand IKSettings, set Left Hand IKPose to the grip's pose such as AS\_Character\_AFGGrip for the AFG. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-484508ed9042162a0c57442f6512e2f2d5e1a219%252Fforward-grip-components.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=99f1d55e718f31bd11ca1e0989d6881d&sv=3) BP\_Foregrip\_VerticalGrip's components: its mesh and SKGOffHandIK. Every example grip is set up this way. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-14936dfcddc34dad02da1e0a743caaef8c473c8c%252Fdetails-panel.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=32b8b9100a5650b3a9c91b4a7a7a8df8&sv=3) BP\_Foregrip\_AFG's SKGOffhandIK settings, tagged as a forward grip with the AFG grip pose Left-handed[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-handguard-and-forward-grip#left-handed) -------------------------------------------------------------------------------------------------------------------------------- The right hand settings are only used if the firearm has Can Use Left Hand Dominate on its [SKGProceduralAnimComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent) . Leave them empty if your game is right-handed only. [PreviousSetting up a magnified optic](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-magnified-optic) [NextSetting up a muzzle device](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-muzzle-device) Last updated 5 days ago Was this helpful? --- # Setting up a magnified optic | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-magnified-optic.md) . This guide sets up a magnified optic such as an LPVO or long range scope such as the example's BP\_Optic\_LPVO. It builds on [Setting up a red dot](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-red-dot) , so read that first. Reticle textures and brightness work the same way and aren't repeated here. Picture in Picture or Normal[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-magnified-optic#picture-in-picture-or-normal) ------------------------------------------------------------------------------------------------------------------------------------------------------- Magnified optics can zoom in two ways, and players can switch between them while playing, like in Insurgency: Sandstorm and Wardogs. * **Picture in Picture**: The zoomed view is rendered onto the lens while everything around the scope stays at normal zoom, like a real scope. Rendering the scene a second time costs more performance, but a lot of work has gone into making these optics look and perform better than any other optic asset on the marketplace. Only the part of the screen the lens covers is rendered, the image is drawn onto the lens in post process using a stencil so it stays sharp, and the [shared view family](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-magnified-optic#shared-view-family) can render it as part of the player's own view instead of as a separate render. * **Normal**: The camera zooms in, optionally with part of the zoom done inside the lens to give it a magnified look. This is the traditional way and costs less. The mode is stored per player and starts on Picture in Picture. Set it by calling `SetMagnifiedOpticMode` on the [SKGShooterPawn component](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent) , such as from your settings menu. It isn't saved for you, so save it with the rest of your game's settings and set it again when the game starts. In the example, IA\_TogglePiP in BP\_PlayerPawn calls `SetMagnifiedOpticMode` to switch between the two. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-d00881deb3ec02d3c27343213cad88fa9720ddc5%252Fpip-vs-normal.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=2c42a069a5115b8e4b8cd4b84d9472f9&sv=3) Aiming the LPVO in Picture in Picture (left), where only the lens zooms, and Normal (right), where the camera zooms in too 1\. Mesh[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-magnified-optic#id-1.-mesh) ----------------------------------------------------------------------------------------------------------------- The example LPVO is made of three meshes. I recommend a separate mesh for the reticle plane as in the example. The lens masking then only has to work with that one mesh, which keeps it cleaner. This is optional and the entire scope can be 1 mesh. If your reticle is on the scope body instead, put both sockets on the body: * **SM\_Optic\_LPVO**, the scope body. Add an S\_ObjectiveLens and S\_SceneCapture socket at the center of the front lens. * **SM\_Optic\_LPVO\_ReticlePlane**, a plane at the rear lens that shows the reticle. In Picture in Picture it displays the zoomed image. The reticle is on material slot 0. Add an S\_RearLens socket at the center of the rear lens with its X axis (red arrow) pointing out the front of the scope, which is a Yaw of 90 on the example's Y-forward mesh. Place it right on the plane's surface, since the zoomed image is only drawn close to it (see Lens Plane Depth Tolerance below). Add the S\_Aim socket here too, as in the red dot guide. * **SM\_Optic\_LPVOOcular**, the eyepiece glass. It's only a separate mesh so it can turn as you zoom like a real one, which the example does from the On Magnification Changed event. This is optional and it can be part of the scope body. The eyebox and field stop are centered on S\_RearLens, and Picture in Picture renders the zoomed view from S\_ObjectiveLens. If either socket is missing, an error is logged when the optic starts. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-f9ff35c2f6f8551fa528256f20526c61f842524a%252Frear-lens-socket.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=6b38e531c7aec07acfcba1aa76ca6dc1&sv=3) S\_RearLens on the LPVO's reticle plane, with its X axis pointing out the front ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-5bf2950271bb17fc1ff544c46803edbee92d67ec%252Fobjective-lens-socket.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=11dcc5eac091de720b83a88aa741506a&sv=3) S\_ObjectiveLens at the center of the LPVO's front lens 2\. Optic Blueprint[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-magnified-optic#id-2.-optic-blueprint) --------------------------------------------------------------------------------------------------------------------------------------- Create an Actor Blueprint and turn on Replicates for multiplayer. Add the scope body and attach the reticle plane and eyepiece to it. The example names them StaticMesh, StaticMeshReticle and StaticMeshOcular. Then add these components: * **SKGOptic** * **SKGProceduralAnim** * **SKGOpticSceneCapture**, attached to the scope body at S\_SceneCapture. Only needed for Picture in Picture. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-29b73256d00880b1708a82d5004ad6a3e25f6b50%252Fstatic-mesh-reticle.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=250ef65f3adc00277875471960a672db&sv=3) StaticMeshReticle attached to the scope body, sitting at the rear lens ### SKGOptic[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-magnified-optic#skgoptic) Every setting is explained on the [SKGOpticComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent) page. These are the ones a magnified optic needs. Under Initialization Settings, set Optic Mesh Name to the scope body (StaticMesh) and Optic Reticle Mesh Name to the reticle plane (StaticMeshReticle). ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-f7d4869cc16ad9b46f869435bf5988c8e96a9905%252Fcomponent-names.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=c117c113ec0e610c5aaf305543701042&sv=3) BP\_Optic\_LPVO's components and the SKGOptic Initialization Settings Under Quality Settings: * Set Reticle Distortion Type to Spherical, so the reticle bends with the round lens. * Lens Distortion Strength bends the image at the edge of the lens, and Lens Distortion Start Offset sets where that starts. Set Lens Distortion Strength to 0 to turn it off. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-933efe771e0d7c2bc6e56f2654491bed6e4eddca%252Fquality-settings.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=8a7a928b427d2f1044abbeadb2f9bdbb&sv=3) The LPVO's Quality Settings Under Magnification Settings: * Turn on Is Magnified. * Add your zoom levels to Magnifications, lowest first, to step through them with `ZoomIn` and `ZoomOut`. To zoom freely between two values instead, turn on Use Min Max Magnification and set Min Magnification and Max Magnification. The LPVO does this, from 1 to 8. * Turn on Is First Focal Plane if the reticle should grow as you zoom in. Leave it off for a second focal plane scope, where the reticle stays the same size. * Optional: Smooth Zoom changes the magnification gradually instead of instantly. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-7b92c0e7d45a91dbd9a4b67d17c748903a0d69af%252Fmagnification-settings.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=ff9ba20f3bc7bb0999acecbd8c811b0f&sv=3) The LPVO's Magnification Settings Under Scene Capture Settings, for Picture in Picture: * Set Optic Scene Capture Component Name to the name of the SKGOpticSceneCapture component. * Turn on Composite in Post Process and set Post Process Composite Material to PPM\_MagnifiedOpticBeforeBloom. This draws the image onto the lens in post process, using a stencil to find the lens, so it stays sharp. The rest can stay at their defaults, but these are worth knowing: * **Size Render Target to Lens**: Leave this on. Instead of rendering the whole screen and only showing the middle, the scope image is only rendered as big as the lens appears on screen at its widest field of view. This is a big part of what keeps Picture in Picture cheap. * **Lens Coverage Margin**: How much extra area around the lens gets rendered when Size Render Target to Lens is on. 1 renders exactly the opening of the field stop (the dark ring), and 1.2 renders 20% more. Raise it slightly if the image repeats or smears at the edge of the lens, which can happen with your eye off center or strong lens distortion. The render target grows with it, so keep it as low as looks right. The LPVO uses 1. * **Min Render Target Size** / **Max Render Target Size**: Limits for that render target's size, in pixels. 256 and 2048 on the LPVO. * **Tick Frequency** / **Tick Interval**: Skip captures to save performance, at the cost of a less smooth scope image. 0 renders every frame. * **Custom Depth Stencil Value**: The stencil value put on the reticle mesh while aiming, so the post process can find the lens on screen. 0 automatically sets it. Don't use the [night vision](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-night-vision) stencil value (25 by default). * **Lens Plane Depth Tolerance**: The zoomed image is only drawn on pixels that have the stencil and are within this distance of the reticle plane in cm. The reticle plane goes through S\_RearLens and faces along its X axis, so S\_RearLens has to sit right on the surface of your reticle plane. If it's further away than the tolerance, the lens shows only part of the image or none at all. Raise it if your reticle plane is curved. Keep it small otherwise so other parts of the reticle mesh near the lens, such as the eyepiece rim when the whole scope is one mesh, don't get the image drawn on them. The LPVO uses 0.25 cm. * **Reticle Plane Socket Name** / **Reticle Plane Forward Offset**: Use a socket on the scope body for the reticle plane instead of S\_RearLens, or move the plane forward. The LPVO's mesh doesn't have an S\_ReticlePlane socket, so it uses S\_RearLens. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-a878f6d8977159340cbd3e0301c6f68ec242f1cb%252Fscene-capture-settings.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=77c770a7c2aa9a08c5a4e23e17080ae3&sv=3) The LPVO's Scene Capture Settings Under Normal Scope Settings, for Normal: * Set Zoom Post Process Material to PPM\_NormalScopeZoom. It draws the lens effects and the zoom inside the lens. * In Scope Zoom Share sets how much of the zoom happens inside the lens. The rest comes from zooming the camera. The LPVO uses 0.25 so 1/4 of the magnification comes from inside of the scope and the rest from the camera. Using to high of a value here can cause the image inside of the scope to become blurry as it is zooming in on the pixels. * Aperture Radius is the radius of the lens opening, 1.65 cm on the LPVO. Parts of the scope inside it are hidden while aiming via the MF\_NormalScopeCutout mask so they don't block your view. See step 3 below. * Aperture Socket Name is the socket the opening is centered on. If the scope body doesn't have that socket, S\_RearLens is used, as on the LPVO. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-bd72d8ad0624ccd428e12b71cda8bb37875e7fed%252Fnormal-scope-settings.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=9ab9aa6eb7d21ec2ff1b039b38ae1627&sv=3) The LPVO's Normal Scope Settings Under Field Stop Settings and Eye Relief Settings, enter the values from your scope's spec sheet. The LPVO sees 110 ft at 1x and 13.1 ft at 8x at 100 yards, with 3.7 in of eye relief and a 24 mm objective lens. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-9204634372906c8dfce67e12943b5e579f6049c8%252Ffield-stop-settings.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=c0e675ca4455faec9fd9f815dd0cbd95&sv=3) The LPVO's Field Stop Settings ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-c5e0741021be29ac487e561cdd4dfb7fea67dcbd%252Feye-relief-settings.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=667faac10046f92434c01cf4b10c8c8c&sv=3) The LPVO's Eye Relief Settings Under Reticle Settings: * Set Reticle Material Index to the reticle plane's slot, 0 on the LPVO. * Set Reticle Material to M\_MagnifiedScope\_Master in SKGSFCore/Materials/Optic. This one is used in Picture in Picture. * Set Normal Reticle Material to M\_NormalScope\_Master. Normal mode doesn't work without it. * Add your Reticle Textures and brightness levels the same way as on a red dot. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-d6a8d3da3db8d9a1c4cf2b59b277fee2306b4597%252Freticle-settings.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=5f1226aabac4dc2999f5fb655a90d647&sv=3) The LPVO's Reticle Settings Under Optic Zero Settings, pick MRAD or MOA for Adjustment Type and how far one click moves the point of impact. The LPVO uses .1 MRAD. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-d8c4aa6511794d72be775cd59dcfef263e9363e9%252Fzero-settings.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=aefcc5d0e15f18aa6e6f66f55d69724a&sv=3) The LPVO's Optic Zero Settings ### SKGOpticSceneCapture[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-magnified-optic#skgopticscenecapture) Attach it to the scope body (I use a S\_SceneCapture socket), facing forward along the scope, and give it the name you set in Optic Scene Capture Component Name. See [SKGOpticSceneCaptureComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticscenecapturecomponent) . ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-e7a428762087ae0d9f864da4a6591c35df31abe4%252Fscene-capture-setup.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=a74aa9875dcbfb2f2f293f904c187a3e&sv=3) SKGOpticSceneCapture attached to the scope body, facing forward ### SKGProceduralAnim[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-magnified-optic#skgproceduralanim) Set it up the same way as on a red dot, with Procedural Mesh Name set to the mesh that has the S\_Aim socket, StaticMeshReticle on the LPVO. See [SKGProceduralAnimComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent) . ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-0d5c59bbfb59e204ac2a3bb5b7b8783a48cea6b0%252Fprocedural-anim.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=e0d7a41ff95fb47127008eaa1e0678da&sv=3) The LPVO's SKGProceduralAnim Initialization Settings 3\. Hide meshes inside the lens in Normal mode[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-magnified-optic#id-3.-hide-meshes-inside-the-lens-in-normal-mode) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- In Normal mode, parts of the scope, firearm, and hands seen through the lens opening are hidden via a mask while aiming so they don't block the zoomed view. Only materials that use MF\_NormalScopeCutout are hidden. The example's M\_Master and M\_Mannequin already use it in the example. I recommend only applying the mask to your own character and firearm parts so you do not have masked materials on every character and firearm and attachment. Skip this step if you only use Picture in Picture. To add it to your own material: 1. Set Blend Mode to Masked. 2. Add MF\_NormalScopeCutout and plug its KeepMask output into Opacity Mask. If the material already has an opacity mask, multiply the two together. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-7981465a04333ce1267f0ff17156bcfdd13ea307%252Fcutout-material.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=5203e1a6831b63d7a4692e5ee3be1c33&sv=3) MF\_NormalScopeCutout plugged into Opacity Mask in M\_Master 4\. Zoom and zero[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-magnified-optic#id-4.-zoom-and-zero) ----------------------------------------------------------------------------------------------------------------------------------- Call these on the [SKGOpticComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent) . You can get it with `GetCurrentOpticComponent` on the [SKGFirearm component](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent) . The example's BP\_PlayerPawn binds them to inputs. * `ZoomIn` / `ZoomOut` change the magnification (IA\_ZoomIn and IA\_ZoomOut). * `PointOfImpactUp`, `PointOfImpactDown`, `PointOfImpactLeft` and `PointOfImpactRight` dial in clicks like turning the turrets (IA\_PointOfImpact\_Up and so on). * To zero for a distance in one call, use `ZeroOpticsForZeroAtLocation` on the SKGFirearm component with the location the bullet reaches at that distance. You can get that location from `GetProjectileLocationAtDistance` on the SKGProjectileWorldSubsystem. In Normal mode the zero moves the bullet instead of the scope image, so fire bullets from `GetMuzzleProjectileTransform` on the SKGFirearm component as covered in [Setting up a firearm](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-firearm) . Shared view family[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-magnified-optic#shared-view-family) ----------------------------------------------------------------------------------------------------------------------------------- Picture in Picture only and optional. By default the zoomed view comes from a scene capture, which renders the whole scene again every frame as its own separate render, with its own scene setup, shadows, and lighting. The shared view family adds the zoomed view to the player's own render as a second view instead, so work that has to be done once per frame is shared between the two. In the example map this brought the cost of aiming the LPVO down from about 3.3 ms to 1.9 ms per frame. It's still being tested, so try it in your project before shipping with it. Turn it on in Project Settings > Plugins > SKG Shooter Framework Optic Settings, under SharedViewFamily. The example project has it on. * **Use Shared View Family for Magnified Optics**: Turns it on. The optic needs Composite in Post Process on under its Scene Capture Settings. * **Shared View Max Shadow Cascades**: How many shadow cascades the zoomed view renders. Lower is cheaper. It only affects cascaded shadow maps, not virtual shadow maps. The example uses 1. * **Keep Scene Textures Grown**: Leave this on. The zoomed view makes the renderer's screen textures bigger, and without this they're thrown away and made again every time you aim and stop aiming, which causes a hitch. It keeps about 200 MB of extra video memory at 1440p. * **Disable Lumen Hardware Ray Tracing**: UE 5.5 and 5.6 only. Those versions switch Lumen from hardware to software ray tracing while aiming, which changes the lighting and adds a few ms when you stop aiming. Turn this on to keep Lumen on software ray tracing the whole time instead. Not needed on 5.7 and newer, or if your project doesn't use hardware ray tracing. * **Idle Transient Heap Reservation MB**: Keeps video memory reserved while not aiming so aiming again doesn't have to allocate it. 0 turns it off. Leave it at 128. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-048450a378891e7fcf052a0e623746a64daedfc9%252Fshared-view-settings.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=00073ef1a8e9745b667d3540ba1ca252&sv=3) The SharedViewFamily settings in the example project: on, with 1 shadow cascade, Keep Scene Textures Grown on and 128 MiB reserved To avoid a hitch the first time a player aims, call `WarmUpSharedView` on the [SKGOpticSceneCaptureComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticscenecapturecomponent) at a quiet moment, such as after equipping the weapon. The scene capture is used instead when HDR output is on, when the optic has Composite in Post Process off, or when the player's view uses Screen Space Global Illumination. Multiplayer PIE with Run Under One Process isn't supported, but packaged and standalone builds work. Digital and thermal optics[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-magnified-optic#digital-and-thermal-optics) --------------------------------------------------------------------------------------------------------------------------------------------------- The example's BP\_Optic\_Thermal is a digital thermal sight. Turn on Is Digital under Scene Capture Settings so the image comes from where SKGOpticSceneCapture is placed, like a camera feeding a screen. Add thermal color palettes such as PPMI\_Thermal\_WhiteHot to Weighted Blendables under Reticle Settings, and switch between them with `CycleNextWeightedBlendable`. Weighted Blendables only work in Picture in Picture. [PreviousSetting up a red dot](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-red-dot) [NextSetting up a handguard and forward grip](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-handguard-and-forward-grip) Last updated 6 days ago Was this helpful? --- # Setting up a muzzle device | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-muzzle-device.md) . This guide sets up a barrel, muzzle device such as a flash hider, and a suppressor. The example projects BP\_M4\_Barrel, BP\_MuzzleDevice\_FlashHider, and BP\_MuzzleDevice\_Suppressor all use the [SKGMuzzleComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgmuzzlecomponent) , which marks where bullets leave from and where firearm collision is checked to. How the firearm picks the muzzle[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-muzzle-device#how-the-firearm-picks-the-muzzle) ------------------------------------------------------------------------------------------------------------------------------------------------------------- The barrel, muzzle device and suppressor can each have an [SKGMuzzleComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgmuzzlecomponent) . The [SKGFirearmComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent) uses the one with the highest Muzzle Tag: Suppressor, then Muzzle Device, then Barrel. On the M4 the barrel takes a flash hider or the oil filter suppressor, and the flash hider takes the suppressor. Add the suppressor and the bullets leave from the end of the suppressor. A firearm with a built-in barrel puts its SKGMuzzle on the firearm with the Barrel tag. 1\. Mesh[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-muzzle-device#id-1.-mesh) --------------------------------------------------------------------------------------------------------------- Add an S\_Muzzle socket just past the end of the muzzle, with its X axis (red arrow) pointing out of the barrel, the direction the bullet travels. A part that something else attaches to also needs a socket for that slot. The flash hider has S\_Attachment\_Muzzle for the suppressor. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-5d6932b459307038dd2849ade651a806b281344b%252Fmuzzle-socket.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=9c9b83ceb5a0e9930f368550eff0fcc6&sv=3) The S\_Muzzle socket just past the end of the suppressor, with the red X arrow pointing out of the barrel ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-8cb116ae9791981e3d5c2d507359c8eed1134f54%252Fflash-hider-sockets.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=bf5a10e33edb998e51014ba779cafa80&sv=3) The flash hider's S\_Muzzle and S\_Attachment\_Muzzle sockets 2\. Barrel[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-muzzle-device#id-2.-barrel) ------------------------------------------------------------------------------------------------------------------- Add an SKGMuzzle component to the barrel. Set Muzzle Mesh Component Name to the barrel's mesh (StaticMesh) and Muzzle Tag to Barrel. Muzzle Socket Name already holds S\_Muzzle. BP\_M4\_Barrel also has an SKGAttachment slot, SKGAttachment\_Muzzle, for muzzle devices. Its compatibility list, DA\_Compatibility\_M4\_BarrelAttachment, has the flash hider and the oil filter suppressor. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-e9d4aa5e0a44a58d445e13ac52f0cdcd7ef5e90d%252Fbarrel-components.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=0871948ff09395b358a9a7ba2e4a91c7&sv=3) BP\_M4\_Barrel's components: its mesh, the SKGAttachment\_Muzzle slot for a muzzle device, and SKGMuzzle 3\. Muzzle device[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-muzzle-device#id-3.-muzzle-device) --------------------------------------------------------------------------------------------------------------------------------- Add an SKGMuzzle component to the muzzle device the same way, with Muzzle Tag set to Muzzle Device. The flash hider also has an SKGAttachment slot on S\_Attachment\_Muzzle, with the suppressor in its compatibility list, DA\_Compatibility\_MuzzleDevice\_FlashHider. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-4c3316b7786115795f8b5c68fd7988ba35d240eb%252Fflash-hider-components.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=77bd27585ae985d61f8bea43bb03ea3c&sv=3) BP\_MuzzleDevice\_FlashHider's components ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-1924a57ceef551468756a9f4fd3cd2c64bcfe0ab%252Fflash-hider-muzzle-settings.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=a136dba82e71950b18c5b982f0fa84d5&sv=3) The flash hider's SKGMuzzle settings, tagged as a muzzle device 4\. Suppressor[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-muzzle-device#id-4.-suppressor) --------------------------------------------------------------------------------------------------------------------------- Add an SKGMuzzle component with Muzzle Tag set to Suppressor. The example's suppressor goes on the flash hider, while BP\_MuzzleDevice\_OilFilterSuppressor goes straight on the barrel. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-2772496dce699c46b0fa90b296f21154103c648b%252Fdetails-panel.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=e50e27e86de9aec8579687817fcc317d&sv=3) BP\_MuzzleDevice\_Suppressor's SKGMuzzle settings, tagged as a suppressor with the temperature system on 5\. Muzzle temperature[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-muzzle-device#id-5.-muzzle-temperature) ------------------------------------------------------------------------------------------------------------------------------------------- Optional. The example suppressor heats up as you shoot, glows, and shows up hot through [thermal optics](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-magnified-optic#digital-and-thermal-optics) . 1. Turn on Use Muzzle Temperature System and set Muzzle Temp Curve, C\_MuzzleTemp\_Suppressor in the example. Increase Muzzle Temperature Amount sets how much each shot heats it, and Decrease Muzzle Temperature Amount Per Tick how fast it cools. See [SKGMuzzleComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgmuzzlecomponent) for how the curve works. 2. Call `ShotPerformed` on the SKGFirearm component for every shot, as covered in [Setting up a firearm](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-firearm) . 3. For the glow, put a material that reads the temperature from custom primitive data on the mesh such as MI\_MuzzleDevice\_Suppressor\_HeatUp (made from M\_HeatUp\_Master). The component writes the temperature to the mesh's custom primitive data every time it changes at Muzzle Temp Custom Primitive Index (0) in the [developer settings](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings#custom-primitive-index) . 4. For thermal optics, turn on Auto Handle Muzzle Thermal Stencil Value, and turn on Render CustomDepth Pass on the mesh. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-0cd60634b52781d341271478a7f1c56f523abf1f%252Ftemperature-curve.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=fff0455a6c96a2b3cea5406daeb0574c&sv=3) C\_MuzzleTemp\_Suppressor, rising from 0 at 25 to 800 at 100 [PreviousSetting up a handguard and forward grip](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-handguard-and-forward-grip) [NextSetting up a light and laser](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-light-and-laser) Last updated 5 days ago Was this helpful? --- # Setting up a light and laser | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-light-and-laser.md) . This guide sets up a weapon light and laser like the example's BP\_LightLaser which goes on the M4 through BP\_LightLaserMount\_45Offset. It uses the [SKGLightLaserComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skglightlasercomponent) . A device can be just a light, a laser, or both. 1\. Mesh[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-light-and-laser#id-1.-mesh) ----------------------------------------------------------------------------------------------------------------- Add an S\_Light socket where the light comes out and an S\_Laser socket where the beam comes out. The light and laser components attach to them. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-a514c7b2f55b6ce00cc7141cb4a3287dca213834%252Flight-laser-sockets.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=042b081c95b5ea446485784a67b0fc75&sv=3) The S\_Light and S\_Laser sockets on SM\_LightLaser 2\. Light and laser Blueprint[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-light-and-laser#id-2.-light-and-laser-blueprint) ----------------------------------------------------------------------------------------------------------------------------------------------------------- Add these components to the attachment: * The device's body mesh such as an NGAL or flashlight. * A **Spot Light**, attached to S\_Light. Skip it for a laser only device. * A **laser beam** mesh attached to S\_Laser and a **laser dot** mesh. Use SM\_Laser and SM\_LaserDot from SKGSFCore/LightLaser, which come with M\_Laser\_Master and M\_LaserDot\_Master on them. The beam is stretched along its Y axis to whatever it hits, and the dot is moved to the hit. Skip both for a light only device. * An **SKGLightLaser** component. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-ed1794d836ab469af07e7c8c9710c46bfc6f2291%252Fcomponents.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=c63f7b434e5482fb93595b7db93767f4&sv=3) BP\_LightLaser's components, with LaserMesh, LaserDot and SpotLight found by name ### SKGLightLaser[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-light-and-laser#skglightlaser) Every setting is explained on the [SKGLightLaserComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skglightlasercomponent) page. These are the ones to set. Under Initialization Settings: * Set Light Component Name, Laser Mesh Component Name, and Laser Dot Component Name to your component names. Leave a name as None if the device doesn't have that part. A laser requires a laser mesh and dot mesh. * Optional: turn on Has Infrared Mode and set Infrared Light Function Material to M\_IRLightFunction so the light and laser can switch to infrared and only show through night vision if you wish it to support infrared mode. Infrared only shows for a player while infrared mode is on, covered in [Setting up night vision](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-night-vision) . ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-5d5f5078162d9630c99275cdbc915f6a87ab32ed%252Finitialization-settings.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=456d2004c8933bbdf54323516237d5db&sv=3) BP\_LightLaser's Initialization Settings Under Laser Settings: * Pick a Laser Color and brightness. * Leave Laser Scale Factor at 20 when using SM\_Laser. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-45099f6dd65903d9dac0e19a2e0f3d699d6e2eea%252Flaser-settings.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=8ebcab31e9ed3b10652017e0f301d317&sv=3) BP\_LightLaser's Laser Settings The color and brightness are sent to the beam and dot meshes as custom primitive data at the indices in the [developer settings](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings#custom-primitive-index) . Under Light Settings, add the brightness levels to Light Intensities, such as 2, 6 and 12 in the example. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-c5c86595dfcb2c9a8ec3c50052b63f86ecc853ad%252Flight-settings.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=f8d6f7ae16e620472fd3ecf6d0188bb9&sv=3) BP\_LightLaser's Light Settings, with three brightness levels Laser Cycle Modes and Light Cycle Modes set which modes the device steps through, such as off, on, infrared and strobe. The defaults work for most devices. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-1871796f58b200dbf1749bc93a491e46377a3304%252Fcycle-modes.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=1670306f538f150c0115258eb9cdb5b7&sv=3) The default Laser Cycle Modes and Light Cycle Modes 3\. Controls[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-light-and-laser#id-3.-controls) ------------------------------------------------------------------------------------------------------------------------- To control every light and laser on the firearm at once, call these on the [SKGFirearmComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent) . The example's BP\_PlayerPawn gets it with `GetCurrentFirearmComponent` on the [SKGShooterPawn component](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent) and binds them to inputs: * `ToggleAllLights` (IA\_ToggleLight) * `ToggleAllLasers` (IA\_ToggleLaser) * `ToggleAllLightsStrobe` (IA\_ToggleLightStrobe) * `CycleAllLightsIntensity` (IA\_CycleLightIntensity) * `SetAllLightLaserInfraredMode` (IA\_ToggleInfraredMode) To control one device, call the functions on its SKGLightLaser component instead. These can be called on the client, and every player sees the change. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-84964d62899f283dba727145a1082ecaf4dd245c%252Fpawn-light-inputs.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=14d7609fb0f4f81795a910cd8acef908&sv=3) BP\_PlayerPawn's laser, light and strobe inputs calling the SKGFirearm component Lens glow[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-light-and-laser#lens-glow) ----------------------------------------------------------------------------------------------------------------- Optional, and only part of the example. BP\_LightLaser makes the light look on with the Blinder, an emissive mesh (SM\_Flashlight\_BlinderSource) that adds bloom in front of the lens. Its material, M\_LightBlinder, reads custom primitive data, so no dynamic material is needed: * On Light Mode Changed checks whether the On flag is set, writes 1 (on) or 0 (off) to the Blinder's custom primitive data at index 0, and hides the Blinder while the light is off. * On Infrared Mode Changed writes 1 or 0 to the index from `GetIsInfraredCustomPrimitiveIndex` (5 by default, set in the [developer settings](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings) ), so an infrared light's Blinder only shows through night vision. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-26d5cb59cbe5f4fce8b6d75bb9f74bb14f01db74%252Flens-glow.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=8fdfd8fa874633e87e793c9bfb9b88bc&sv=3) BP\_LightLaser setting the Blinder's custom primitive data and visibility when the light or infrared mode changes [PreviousSetting up a muzzle device](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-muzzle-device) [NextSetting up night vision](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-night-vision) Last updated 5 days ago Was this helpful? --- # Creating a custom pose | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/creating-a-custom-pose.md) . A pose moves the held item to a new position and rotation and back again, such as high port, low port, short stock, blind fire, sprint, etc. Poses are made from curves instead of animations, so the M4 and the bolt action in the example share the same ones. This guide uses the example's high port pose, DA\_Pose\_HighPort, as the example. How a pose works[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/creating-a-custom-pose#how-a-pose-works) ------------------------------------------------------------------------------------------------------------------------- Every pose has a gameplay tag. Call `PerformProceduralPose` on the [SKGShooterPawnComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent) with that tag, and the pose with that tag on the held item's [SKGProceduralAnimComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent) plays. A pose has two sets of curves: * The **To Curve** goes into the pose, such as from idle to high port. The firearm stays at the end of the To Curve until you leave the pose. * The **From Curve** goes from the pose back to idle. Each has a First Person Curve and a Third Person Curve, so a pose can look right in both. The Third Person Curve plays in third person and on other players' screens. 1\. Gameplay tag[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/creating-a-custom-pose#id-1.-gameplay-tag) --------------------------------------------------------------------------------------------------------------------------- Make a tag for the pose, such as Poses.HighPort. The example keeps its pose tags in the DT\_Poses data table in SKGSFExampleContent/Data/DataTables/GameplayTags: Poses.HighPort, Poses.LowPort, Poses.ShortStock and Poses.Sprint. To make your own table, create a Data Table with the GameplayTagTableRow structure, then add it to Gameplay Tag Table List in Project Settings > Gameplay Tags. You can also add the tag in Project Settings like any other tag. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-1dd4126ebc7c5956a1dc1c39c8bf738424d6325b%252Fdt-poses.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=0cfa817659a0c98cdcb159dc4ad903df&sv=3) DT\_Poses with the example's four pose tags 2\. Find the values[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/creating-a-custom-pose#id-2.-find-the-values) --------------------------------------------------------------------------------------------------------------------------------- The example has a pose customization widget for finding where the firearm should end up. Press Play, hold the firearm and press G. Type a location and rotation into the boxes and the firearm moves there. Load Current Pose fills the boxes with where the firearm is now, so you can play a pose and press it to see that pose's values. * Location is in cm. X is forward and back, Y is right and left, Z is up and down. * Rotation is in degrees. X is roll, Y is pitch, Z is yaw. The curves use the same axes, so the numbers go straight into them. They're the same for X forward and Y forward firearms. Firearm Collision switches the boxes to the pose used when the firearm is pushed back by a wall. The high port ends at a location of -8.75, 3.75, -17.5 and a rotation of -2.5, 30, 0, which pulls the firearm back and down and pitches it up 30 degrees. The widget is the example's WBP\_PoseCustomization. It calls `SetTestPose` and `GetCurrentPoseValues` on the anim instance, so you can migrate it to your project and use it there. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-668242c9a3ad18745a9ab535657a21a71961a0c4%252Fpose-customization.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=1dd7ec5fe2c4c872a2ebb4ef4b104ff1&sv=3) The pose customization widget after pressing Load Current Pose in high port 3\. To Curve[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/creating-a-custom-pose#id-3.-to-curve) ------------------------------------------------------------------------------------------------------------------- Right-click in the Content Browser and pick Miscellaneous > Curve > CurveVector. Make one for location and one for rotation. The example's are C\_Pose\_Sample\_HighPort\_Location and C\_Pose\_Sample\_HighPort\_Rotation in SKGSFCore/SampleCurves/Poses. In each curve, key X, Y and Z at time 0 with a value of 0, then key them again at the end with the values from the widget. Right-click the keys and pick Cubic (Auto) so the firearm eases in and out instead of moving in a straight line, then add keys in between to shape it, such as the high port's X pushing forward before pulling back. Opening the example's curves is the quickest way to see a finished one. The curve's time is multiplied by the Play Rate you set in step 5. The high port curves end at 6 with a Play Rate of 12, so they take half a second. The curve ends at its last key on any of its X, Y and Z channels. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-52d9940dcd34ac16cd9aea2e7a866eb4d4b01c69%252Flocation-curve.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=df5f90b37ed11ec2d335cb13051f66a5&sv=3) C\_Pose\_Sample\_HighPort\_Location, ending at -8.75, 3.75 and -17.5 at 6 4\. From Curve[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/creating-a-custom-pose#id-4.-from-curve) ----------------------------------------------------------------------------------------------------------------------- Duplicate both curves and add \_Return to the names. Reverse them so they start at the To Curve's end values at time 0 and end at 0. They must end at 0, or the firearm stays offset after leaving the pose. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-7fe671a75cc972b7a61e09a6b89f29ea23539c60%252Flocation-return-curve.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=220eda1adbd68407b04747d10b0beebb&sv=3) C\_Pose\_Sample\_HighPort\_Location\_Return, going from the high port values back to 0 5\. Pose settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/creating-a-custom-pose#id-5.-pose-settings) ----------------------------------------------------------------------------------------------------------------------------- Right-click in the Content Browser and pick SKG > Data Assets > ProceduralAnim > Procedural Pose Settings. The example's poses are in SKGSFExampleContent/Data/ProceduralSettings/Poses. * Set Curve Tag to your tag. * Under To Curve, set the First Person Curve's Location Curve and Rotation Curve to your two curves, and its Play Rate. Set the Third Person Curve too, otherwise other players won't see the pose. The same curves work if you don't need different ones. * Under From Curve, do the same with the \_Return curves. * Optional: turn on Interpolate to blend toward the curve instead of following it exactly, at Interpolation Speed. This smooths switching poses partway through. The pose is ignored unless it has a Curve Tag, a To Curve and a From Curve. Every setting is explained on the [SKGProceduralAnimComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent#pose-settings) page. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-4078e8c8ddda09776e62668aae42c000edeccd31%252Fpose-data-asset.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=69b947d1acf049f720ed7c201e4b4dd4&sv=3) DA\_Pose\_HighPort's settings, with a Play Rate of 12 and Interpolate on 6\. Add it to the firearm[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/creating-a-custom-pose#id-6.-add-it-to-the-firearm) --------------------------------------------------------------------------------------------------------------------------------------------- Select the firearm's [SKGProceduralAnim](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent) component and add the data asset to Pose Settings Data Assets. The M4 and the bolt action both have DA\_Pose\_HighPort, DA\_Pose\_LowPort, DA\_Pose\_ShortStock and DA\_Pose\_Sprinting. For a held item that isn't a firearm, add it to that item's SKGProceduralAnim component. You can add the pose straight to Pose Settings on the component instead, but don't use both. If Pose Settings Data Assets has anything in it, it replaces Pose Settings. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-5de35ebe2469651567ec0db4485fd923f1e99fc0%252Ffirearm-poses.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=6d24a86c4f4904ea5b7399906180bea8&sv=3) BP\_M4's SKGProceduralAnim component with its four pose data assets 7\. Play the pose[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/creating-a-custom-pose#id-7.-play-the-pose) ----------------------------------------------------------------------------------------------------------------------------- Call `PerformProceduralPose` on the [SKGShooterPawnComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent) with the tag. With Exit Pose off it plays the To Curve, and with it on it plays the From Curve. Call it on the client. It's sent to the server and every player sees it. On Pose Complete fires when a curve finishes. The example's BP\_PlayerPawn plays high port on mouse wheel up, low port on mouse wheel down and short stock on middle mouse. Each key checks `CanPerformPose`, which makes sure you aren't sprinting, and that you aren't aiming, since the mouse wheel zooms while aiming. Then it calls the TryGoToPose event. If you're in a pose, TryGoToPose plays that pose's exit, otherwise it goes into the key's pose, so pressing the key again goes back to idle. Sprinting plays Poses.Sprint. To test a new pose quickly, swap the tag on one of the keys for yours. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-739c757a3a219628fcb0d066f3c08ea24fdc1f55%252Fpawn-pose-inputs.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=5ac4393567331d23dcfd5a53640133b1&sv=3) BP\_PlayerPawn's TryGoToPose event and the middle mouse, mouse wheel up and mouse wheel down keys that call it Left-handed[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/creating-a-custom-pose#left-handed) --------------------------------------------------------------------------------------------------------------- Make the curves for right-handed. When the firearm is held left-handed, the Y location, roll and yaw are mirrored for you. [PreviousHolding other items](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/holding-other-items) [NextPerforming animations](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/performing-animations) Last updated 6 days ago Was this helpful? --- # Troubleshooting | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/troubleshooting.md) . Common problems and what to check. Many setup mistakes also log an error to the Output Log, so check it first. If you're still stuck, ask on the [Discord](https://discord.gg/W5g6pZXfjh) . Setup[](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/troubleshooting#setup) ----------------------------------------------------------------------------------------------- **Nothing works and the materials or anim layer are missing.** SKGSFCore hasn't been migrated into your project. See [Project Setup](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/project-setup) . **Optics, night vision or thermal don't show up at all.** Check that Custom Depth-Stencil Pass is set to Enabled with Stencil in Project Settings > Engine > Rendering, and that the SKGSF Material Parameter Collection is set to MPC\_SKGSF in [Developer Settings](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings) . Project settings aren't copied when you migrate content. Holding and aiming[](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/troubleshooting#holding-and-aiming) ------------------------------------------------------------------------------------------------------------------------- **The firearm doesn't move with the procedural animation, or floats away from the hands.** * The skeleton needs ik\_hand\_gun, ik\_hand\_r, ik\_hand\_l (the mannequin already has these) and the three virtual bones. See [Setting up a pawn](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-pawn) . * The animation blueprint needs the SKGSFProcedurals layer, the Copy Bone from VB ik\_hand\_gun to ik\_hand\_gun to move the firearm and the hand IK to move the hands to the firearm. See [Setting up the animation blueprint](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-the-animation-blueprint) . * `SetHeldActor` has to be called on the server, and it doesn't attach the actor for you. Attach the firearm to the mesh at ik\_hand\_gun. **Aiming doesn't line up with the sight.** * The S\_Aim socket should be in the middle of the sight window, where the eye looks through, with no rotation. See [Setting up a red dot](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-red-dot) . * If the socket is set up correctly but the firearm is rotated 90 degrees when aiming, Mesh Forward Axis in Project Settings > Plugins > SKG Shooter Framework doesn't match your meshes, such as X forward meshes with the setting on Y Forward. The framework uses this setting to know which way every firearm and attachment faces, so it has to match them. See [Developer Settings](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings#procedural-animation) . * Aiming lines the sight up with the camera. When it starts, the SKGShooterPawn component finds the camera by its Camera Component Name and saves where it sits relative to the mesh's head bone. If it can't find the camera, it uses the Camera Attached Socket on the mesh instead, S\_Camera by default. If your camera moves relative to the head after that, such as from a head animation, turn on Constantly Update Camera Offset so the position is updated every frame. See [SKGShooterPawnComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent) . **The firearm doesn't get pushed back by walls.** Firearm collision needs an [SKGMuzzleComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgmuzzlecomponent) to know where the muzzle is, and the walls need to block the Firearm Collision Channel set in [Developer Settings](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings) . **The offhand doesn't hold the handguard or grip.** Check the S\_LeftHandIK socket, the Offhand IKMesh Name and the Offhand IKTag. See [Setting up a handguard and forward grip](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-handguard-and-forward-grip) . If it only happens during a montage, its OffhandIKCurveAlpha curve is still at 1. See [Performing animations](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/performing-animations) . **A pose doesn't play.** A pose needs a Curve Tag, a To Curve and a From Curve, and has to be on the held item's SKGProceduralAnim component. If Pose Settings Data Assets has anything in it, it replaces Pose Settings. If other players don't see it, set the Third Person Curve. See [Creating a custom pose](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/creating-a-custom-pose) . Attachments[](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/troubleshooting#attachments) ----------------------------------------------------------------------------------------------------------- **An attachment won't go into a slot.** * With Use Legacy Attachment System on, the attachment has to be in one of the slot's Compatible Attachments, or the list has to be empty to accept all attachments. * With gameplay tags, the attachment has to implement the gameplay tags interface, such as by being based on SKGBaseActor or your own c++ actor that implements it, and the slot's tag needs a row in a compatibility table. A slot whose tag has no row accepts nothing. See [Gameplay tag attachment compatibility](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/gameplay-tag-attachment-compatibility) . * The Default Attachment has to pass the same check. Optics[](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/troubleshooting#optics) ------------------------------------------------------------------------------------------------- **The magnified optic's lens is empty or only shows part of the image.** * The optic mesh needs S\_ObjectiveLens and the reticle mesh needs S\_RearLens. * S\_RearLens has to sit right on the reticle plane's surface, within Lens Plane Depth Tolerance. * The optic's Custom Depth Stencil Value can't be the night vision's Lens Stencil Value (25). See [Setting up a magnified optic](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-magnified-optic) . **A Normal mode optic doesn't zoom.** Allow SKGCamera FOVChanges is likely off in [Developer Settings](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings) . **Aiming a magnified optic hitches the first time.** With the shared view family on, call `WarmUpSharedView` at a quiet moment, such as after equipping the weapon. See [Shared view family](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-magnified-optic#shared-view-family) . **In multiplayer PIE, one player's scope shows in another player's window.** The shared view family doesn't support PIE with Run Under One Process. Turn that off or test in standalone. Packaged and standalone builds work. Night vision, infrared and thermal[](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/troubleshooting#night-vision-infrared-and-thermal) -------------------------------------------------------------------------------------------------------------------------------------------------------- **Night vision turns on but the image doesn't show.** * The two night vision materials have to be added as blendables on a Post Process component for the local player, with their weight set to 1 while the tubes are on. * With the Mesh Visual Type, check Lens Mesh Name and Eyebox Center Locations. The lens doesn't get its stencil without them. * If you changed Lens Stencil Value, change NightVisionStencilValue in MPC\_SKGSF to the same value. See [Setting up night vision](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-night-vision) . **Infrared lights and lasers don't show through night vision.** `EnableInfraredMode` has to be called on the SKG Infrared World Subsystem for the local player when night vision turns on. The light or laser also needs Has Infrared Mode on and M\_IRLightFunction as its Infrared Light Function Material. See [Setting up night vision](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-night-vision) and [Setting up a light and laser](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-light-and-laser) . **The red dot is blinding through night vision.** Turn on Supports Night Vision on the SKGOptic, add Reticle Night Vision Brightness Settings and call `ToggleReticleNightVisionSetting`. See [Setting up a red dot](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-red-dot) . **Hot objects don't show up in thermal optics.** The mesh needs Render CustomDepth Pass on. For a body, check its component tag on the [SKGObjectTemperatureComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgobjecttemperaturecomponent) . For a muzzle, turn on Auto Handle Muzzle Thermal Stencil Value on the [SKGMuzzleComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgmuzzlecomponent) . Make sure the Temperature MPC is set in [Developer Settings](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings) . Other[](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/troubleshooting#other) ----------------------------------------------------------------------------------------------- **The laser goes through things, or stops on things it shouldn't.** It stops at anything that blocks the Laser Collision Channel in [Developer Settings](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings) . [PreviousMultiplayer](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/multiplayer) [NextUpdating to 2.0.0](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/updating-to-2-0-0) Last updated 6 days ago Was this helpful? --- # Setting up a pawn | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-pawn.md) . This guide sets up a pawn function with the SKG Shooter Framework. It is not dependent on ACharacter. It works with Pawn and Character classes so it also works with the General Movement Component (GMC) or Mover. The example's BP\_PlayerPawn is a Character using the UE5 mannequin (SK\_Mannequin). There are four steps: the skeleton, the pawn Blueprint, input, and the animation blueprint, which has its own guide in [Setting up the animation blueprint](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-the-animation-blueprint) . 1\. Skeleton[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-pawn#id-1.-skeleton) -------------------------------------------------------------------------------------------------------------- The skeleton needs the hand IK bones ik\_hand\_gun, ik\_hand\_r and ik\_hand\_l. The UE5 mannequin already has them. If you are using metahuman's, you will need to add these (simple process). ### Virtual bones[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-pawn#virtual-bones) The procedural animation moves virtual bones on the head instead of the real IK bones, so the lower body's locomotion can't pull on it. Open your skeleton, right-click the bone in the table, pick Add Virtual Bone, pick the target bone, and type the name. Unreal adds VB in front of it so typing ik\_hand\_gun\_parent ends up being VB ik\_hand\_gun\_parent which is correct. Name Right-click on Target bone ik\_hand\_gun\_parent head head ik\_hand\_gun\_ads VB ik\_hand\_gun\_parent head ik\_hand\_gun VB ik\_hand\_gun\_parent ik\_hand\_gun FirearmCollision head ik\_hand\_root ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-3dac3ca3b3b8af85a62748d060ec80829bca149f%252Fvirtual-bones.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=0ce7690386b415ce0f56bfdaf8704671&sv=3) SK\_Mannequin's virtual bones and S\_Camera under the head ### Camera socket[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-pawn#camera-socket) Right-click head, pick Add Socket, and name it S\_Camera. That's the [SKGShooterPawnComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent) 's default Camera Attached Socket. Move it to where you want the "eyes" to be. The example puts it just in front the middle of the head. Then rotate it so a camera attached to it faces forward and upright. On the UE5 mannequin, use Pitch 0, Yaw 90, Roll -90, which the socket's Relative Rotation shows as -90, 0, 90. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-51e5d104a8be53978ef298e3bbc6271e4b155927%252Fcamera-socket.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=972621bb735455a8a6f7772c2829371a&sv=3) S\_Camera on SK\_Mannequin's head ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-2b7ed0543d8de307a6b0dd00d353dfcedb02a76c%252Fcamera-socket-rotation.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=b45dc6fc94fefe2c651534fbe14b7b1c&sv=3) S\_Camera's Relative Rotation on the UE5 mannequin ### Upper body blend mask[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-pawn#upper-body-blend-mask) The animation blueprint plays the procedural animation on the upper body only using a blend mask. The example's is UpperBodyLowerBodySplitMask. 1. Click the gear icon above the skeleton tree, pick Blend Profiles > Add Blend Mask, and name it. Existing blend masks are listed in the same menu, so pick one there to edit it later. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-f90a1fe7bdd818417584f84f9ddde642b5f12663%252Fblend-mask-menu.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=e65ae287c269cfccc789f3be27cd89ec&sv=3) The gear icon's Blend Profiles menu, with UpperBodyLowerBodySplitMask selected for editing 2. Set ik\_hand\_root to 1, right-click it and pick Recursively Set Blend Scales To 1. Do the same for spine\_01. The legs and everything else stay at 0. 3. Lower the spine so the upper body blends in gradually. The example uses pelvis 0.1, spine\_01 0.25, spine\_02 0.3, spine\_03 0.4, spine\_04 0.5, spine\_05 0.6, and 0.75 on both clavicles. The arms, neck, head and virtual bones stay at 1. 4. Note that anytime you make a change to the blend mask, you should compile the animation blueprint using it (I have had issues in the past of it not updating and requiring a compile, granted that was in older engine versions so I recommend it). ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-b5650e1bac5f4cb2b7f97d8c0e7afd31e40ac1dd%252Fblend-mask.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=0456c0a8a810409d5cf755d52158065c&sv=3) UpperBodyLowerBodySplitMask: the IK bones and upper body at 1, the spine ramping up from the pelvis, and the legs at 0 2\. Pawn Blueprint[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-pawn#id-2.-pawn-blueprint) -------------------------------------------------------------------------------------------------------------------------- 1. Set the mesh's Anim Class to your animation blueprint. 2. Add a CameraComponent (can be a Gameplay Camera), attach it to the mesh on S\_Camera, and turn on Use Pawn Control Rotation (unless you want leaning to rotate the camera). 3. Add an SKGShooterPawn component. Set its mesh and camera names to match your components. For one mesh, like the example, turn on Use Single Mesh. Every setting is on the [SKGShooterPawnComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent) page. 4. For a Character, you can set the Character Movement's Component Class to [SKGCharacterMovementComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgcharactermovementcomponent) for sprinting. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-267610a4288f2e6f37d3ce59d72be0a60be81394%252Fcomponents.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=6a01cd5f71d43d1ab32e3da7bf70c6f4&sv=3) BP\_PlayerPawn's components ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-bb82e8b6c0be81567bc74347dd60b9da3ee0bb23%252Fcamera.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=e6eba20269cfaf79539639a99eeb28db&sv=3) BP\_PlayerPawn's Camera on S\_Camera with Use Pawn Control Rotation on 3\. Input[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-pawn#id-3.-input) -------------------------------------------------------------------------------------------------------- The example's BP\_PlayerPawn uses Enhanced Input. Your input works like any other project's. You just pass some of it through the SKGShooterPawn component as well so the framework can handle the parts that depend on it such as deadzone, free look, and scaling look sensitivity to the zoom of a magnified optic. If you do not want to use these features, then you can ignore them and just add to your controllers pitch and yaw like normal. ### Look[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-pawn#look) Look input is where most of this happens: 1. **Magnified optics**: While aiming, multiply the look input by `GetMagnificationSensitivityMultiplier`. Looking through a 4x scope would otherwise feel 4 times faster than normal, so this scales the sensitivity down to match the zoom. It also includes the optic's own Sensitivity Scale. 2. **Free look**: Add yaw only when `CanAddYaw` is true, and pitch only when `CanAddPitch` is true. They turn false when free look reaches its limits, so the view stops there. 3. **Deadzone**: Pass the look input to `SetMouseInput`. Deadzone uses it to let the firearm drift off center as you move the mouse, and free look uses it to check its limits. Run it on Triggered, Canceled and Completed, so the input goes back to 0 when the mouse stops. `GetSensitivityMultiplier` does steps 1 and 2 in one call if you prefer. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-685d175dc02dd42ef4e37e4eec0a3478021fa181%252Flook-input.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=e3b5071e295755d613c90d345b2f8a25&sv=3) BP\_PlayerPawn's look input, with its own Mouse Sensitivity on top ### Aim, lean and free look[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-pawn#aim-lean-and-free-look) These are just examples of how BP\_PlayerPawn uses them. Call these functions from whatever input or game logic suits your project, such as a toggle to aim instead of holding a button. #### Aim[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-pawn#aim) `StartAiming` on Started and `StopAiming` on Canceled and Completed. The example also stops sprinting and lowers the sway while aiming. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-615b22a18ade040bf7c2b4db4b21286f33cbe15d%252Faim-input.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=5c4ffb95f9a1010854d069bde2e105be&sv=3) BP\_PlayerPawn's aim input #### Lean[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-pawn#lean) `Lean` with the input's value on Triggered, such as -1 to 1 from two keys, and `Lean` with 0 on Canceled and Completed to stand back up. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-3dd09042efec09c79caa530c74b855144c831806%252Flean-input.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=f44d9df20a4ce4d631733c890e3c671d&sv=3) BP\_PlayerPawn's lean input #### Free look[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-pawn#free-look) `StartFreeLook` on Started and `StopFreeLook` on Canceled and Completed. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-4f2c17f0dacf880b762bc72a40560d8408a6fc0e%252Ffree-look-input.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=91ad62016da71a9448be2129ed592ce1&sv=3) BP\_PlayerPawn's free look input 4\. Holding something[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-pawn#id-4.-holding-something) -------------------------------------------------------------------------------------------------------------------------------- Call `SetHeldActor` on the SKGShooterPawn component on the server when the player picks up or equips something, such as a firearm, and `ClearHeldActor` when they drop it. `SetHeldActor` doesn't attach the actor to the pawn, so attach it to the mesh yourself. The example's OnPickupSet event sets the held actor, then attaches it to the mesh at the socket in its Firearm Attach Socket variable, ik\_hand\_gun. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-523d1259c1ca1322d79ea6d96fd7af99d9f2d3f4%252Fset-held-actor.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=22c197da81086af27514bc256103a522&sv=3) BP\_PlayerPawn's OnPickupSet sets the held actor, then attaches it to the mesh [PreviousUpdating to 2.0.0](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/updating-to-2-0-0) [NextSetting up the animation blueprint](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-the-animation-blueprint) Last updated 6 days ago Was this helpful? --- # Updating to 2.0.0 | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/updating-to-2-0-0.md) . This page is only for projects that used the framework before 2.0.0. If you're starting fresh, follow [Project Setup](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/project-setup) instead. The tools below change and save your assets in place, and step 5 replaces SKGSFCore, so back up your project or commit it to version control first. If you changed anything inside SKGSFCore, copy it somewhere else first. 1\. Update the plugin[](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/updating-to-2-0-0#id-1.-update-the-plugin) ----------------------------------------------------------------------------------------------------------------------------------- Replace the plugin in your project's Plugins folder with 2.0.0, then open your project. 2\. Correct Data Assets From Previous Values[](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/updating-to-2-0-0#id-2.-correct-data-assets-from-previous-values) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Every project should run this once. In 2.0.0, every settings group can be set right on the component or come from a data asset, such as the optic's Initialization Settings with an Initialization Settings Data Asset field next to it. To make that work, each data asset now holds a single struct with all of its settings, instead of separate properties. See [Data Assets](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/data-assets) . ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-de3c397ff03459c7c817f315a3b52b7f5a781244%252Fsettings-struct.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=38230eca81047f56df5a82302f64262e&sv=3) The SKGOptic component's Initialization Settings, with the Initialization Settings Data Asset field above them Your data assets still have their old values saved. Run Tools > SKG Shooter Framework > Correct Data Assets From Previous Values to move them into the new structs so you don't lose them. It updates and saves every SKG data asset in the project that still has old values, then lists the ones it changed. Movement Lag Settings and Rotation Lag Settings data assets are always included, see Aim lag settings under Other changes. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-e9b383432f88dd65a209b8f4edf61cc803e0488f%252Ftools-menu.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=6ca41698c86877056937d68de9bc869b&sv=3) The SKG Shooter Framework section in the Tools menu 3\. Convert Y-Forward Settings to X-Forward[](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/updating-to-2-0-0#id-3.-convert-y-forward-settings-to-x-forward) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Only run this if your project uses Y forward assets, and only run it once. Procedural values and curves now use the engine's axes no matter which way your meshes face. Location X is forward and back, Y is right and left, and Z is up and down. Rotation X is roll, Y is pitch, and Z is yaw. Before 2.0.0, Y forward projects had X and Y swapped. For example, a positive X on a recoil curve used to move the firearm right, and now it moves it forward, while a positive Y used to move it forward and now moves it right. Rotation lag and the other rotation settings now follow the engine's roll, pitch, and yaw too. Run Tools > SKG Shooter Framework > Convert Y-Forward Settings to X-Forward after step 2, since it converts the values step 2 moved into the structs. It converts your data assets and the curves they use, keeping your keys and tangents, and lists what it changed. * **Only run it once.** Running it again converts everything again and breaks the values. * Curves are changed in place, so anything else that uses the same curve sees the converted values too. * Settings set directly on a component in a Blueprint, or in C++, aren't converted. Update those by hand if you need to. * Combined rotations may need a small adjustment afterward. * Your meshes aren't changed. Keep Mesh Forward Axis in [Developer Settings](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings) on Y Forward. 4\. Save all[](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/updating-to-2-0-0#id-4.-save-all) ----------------------------------------------------------------------------------------------------------------- Use File > Save All so everything the tools changed is saved. 5\. Replace SKGSFCore[](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/updating-to-2-0-0#id-5.-replace-skgsfcore) ----------------------------------------------------------------------------------------------------------------------------------- Some materials and other assets in SKGSFCore have moved or no longer exist in 2.0.0, so the old ones need to be removed instead of copied over. 1. Close your project and delete everything in its SKGSFCore folder in File Explorer. Deleting with the editor closed keeps your Blueprint references to these assets so they connect to the new ones with the same names. 2. Open the updated 2.0.0 example project, right-click its SKGSFCore folder in the Content Browser, pick Migrate and pick your project's Content folder. Make sure only items in the SKGSFCore folder are checked. 3. Open your project. Anything that still points to an asset that no longer exists shows up as a missing reference, so you can point it at its replacement. 6\. Project settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/updating-to-2-0-0#id-6.-project-settings) --------------------------------------------------------------------------------------------------------------------------------- 2.0.0 uses one material parameter collection, MPC\_SKGSF, instead of separate ones. In [Developer Settings](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings) , set SKGSF Material Parameter Collection on the SKG Shooter Framework page and Temperature Material Parameter Collection on the SKG Shooter Framework Temperature Settings page to MPC\_SKGSF. Other changes[](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/updating-to-2-0-0#other-changes) ----------------------------------------------------------------------------------------------------------------- * **Mannequin and animations**: The mannequin (SK\_Mannequin, SKM\_Manny and their materials and rigs), the locomotion animations, AS\_BasicRifleIdle and the grip poses moved from SKGSFCore to SKGSFExampleContent, in SKGSFExampleContent/Assets/Mannequin and SKGSFExampleContent/Animation/MannyAnimations. AnimBP\_SKGSF\_PlayerPawn is now AnimBP\_SKGSF\_PlayerPawn\_Template, a reference with no skeleton. If you used any of them, migrate them from the example project or use your own. The anim layers, such as AnimLayer\_SKGSF\_Procedurals, are templates now too, so you no longer assign your skeleton to them. See [Setting up the animation blueprint](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-the-animation-blueprint) . * **Laser and muzzle temperature**: The laser's color, brightness and infrared flag and the muzzle temperature are now written to the meshes' custom primitive data instead of dynamic materials, so Laser Material, Laser Dot Material, Muzzle Temp Material Parameter Name and `RegisterDynamicMaterial` are gone. Set the materials right on the laser, laser dot and muzzle mesh components, and remove any `RegisterDynamicMaterial` calls from your Blueprints as they no longer exist. If you made your own laser or heat up materials, read these values from custom primitive data at the Custom Primitive Index settings in [Developer Settings](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings#custom-primitive-index) . * **Attachment compatibility**: To fix a typo (my bad) FSKGAttachmentSlotCompatbility was renamed to FSKGAttachmentSlotCompatibility and Slot Compatbility Override to Slot Compatibility Override. Your assets load with the new names automatically, but open and save your slot compatibility data tables once, or they won't show up in Slot Compatibility Table List. See [Gameplay tag attachment compatibility](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/gameplay-tag-attachment-compatibility) . * **Optic settings**: Thermal Scene Capture GIMethod and Thermal Scene Capture Reflection Method are now Digital Scene Capture GIMethod and Digital Scene Capture Reflection Method. If you changed them, set them again in [Developer Settings](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings) . * **Aim lag settings**: Movement Lag Settings and Rotation Lag Settings have new Aim Spring Interp Settings and Aim Interp Settings that blend in while aiming. See [SKGProceduralAnimComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent#movement-lag-settings) . Correct Data Assets From Previous Values copies your Spring Interp Settings and Interp Settings into them every time it runs, so aiming feels the same as before. Set your aim values after you run it. Settings set directly on a component aren't copied, so copy those by hand. [PreviousTroubleshooting](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/troubleshooting) [NextSetting up a pawn](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-pawn) Last updated 5 days ago Was this helpful? --- # Setting up attachments | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-attachments.md) . An attachment is any actor that goes into a slot on the firearm or on another attachment such as a barrel, handguard, stock, or optic. The example's M4 is built this way: its receiver has slots for the barrel, handguard, stock, pistol grip, charging handle and optic, and the handguard has its own rail slots. The attachment system is optional. If you use your own (common when using inventory systems), call `AddAttachment` and `RemoveAttachment` on the [SKGFirearmComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent) whenever an attachment is added or removed, and skip this guide. Set up the firearm first, as covered in [Setting up a firearm](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-firearm) . 1\. Add the manager to the firearm[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-attachments#id-1.-add-the-manager-to-the-firearm) --------------------------------------------------------------------------------------------------------------------------------------------------------------- Add an SKGAttachmentManager component to the firearm, then set the SKGFirearm component's Attachment Manager Component Name to its name. The firearm now finds every attachment for you, including ones on other attachments. See [SKGAttachmentManagerComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentmanagercomponent) . ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-95b787182b1554f244b34d9394628fd549647c66%252Ffirearm-manager-name.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=0f51e0faec6368d08b6006e41ea47778&sv=3) The SKGFirearm component pointing to the SKGAttachmentManager 2\. Add a slot[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-attachments#id-2.-add-a-slot) ----------------------------------------------------------------------------------------------------------------------- Every slot setting used below such as the rail's snap distance and how far an attachment can move is explained on the [SKGAttachmentComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentcomponent) page. Do this for each place an attachment can go: 1. Add a socket to the mesh where the attachment goes, such as S\_Attachment\_Barrel. This is where the attachment will be placed. 2. Add an SKGAttachment component and name it after the slot, such as SKGAttachment\_Barrel. Set Attach to Mesh Name to the mesh it will be attaching to (such as FirearmMeshComponent for the barrel in the example) and Attach to Socket to the socket (such as S\_Attachment\_Barrel for the barrel in the example). 3. Set Default Attachment to the attachment it starts with, such as BP\_M4\_Barrel. Turn on Is Required to Function for parts the firearm can't work without if you wish to have a system built around this (think disabling a firearm from shooting if you do not have a barrel). 4. Pick which attachments fit, under Compatibility. Leave Use Legacy Attachment System on, which is the default. The gameplay tag system is covered in [Gameplay tag attachment compatibility](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/gameplay-tag-attachment-compatibility) . Make a data asset with SKG > Data Assets > Attachment > Attachment Compatibility Settings, list the attachments that fit, and add it to Compatible Attachments. Leave Compatible Attachments empty to allow any attachment. 5. For a rail that the attachment can slide along, such as an optic rail, leave Use Offset System on and set the rail's snap distance and how far it can move. Turn it off for slots that don't move, such as a barrel. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-026c5ad2ce42a3ac2829ddac6ae94c2b38d6c567%252Fattach-to-socket.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=5b45e203eaac22f43726db18778c94b9&sv=3) The S\_Attachment\_Optic socket on the M4 ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-a8af6492cebee2bd1e1a77543e12afce66487d40%252Fdetails-panel.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=59527789463ba49f4e4a84fd4eaf2fd1&sv=3) The M4's optic slot ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-662ec4b5693a4acea63d25cebb6aeaef599a62a7%252Fcompatible-attachments.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=6717d1d3fddb9ec9324063a283f77535&sv=3) A compatibility data asset listing the optics that fit the M4 3\. Make an attachment[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-attachments#id-3.-make-an-attachment) --------------------------------------------------------------------------------------------------------------------------------------- 1. Create an Actor Blueprint and turn on Replicates for multiplayer. The slot spawns the attachment on the server, and it replicates to everyone. 2. Add its mesh. 3. Add the SKG components it needs. A handguard gets an [SKGOffhandIKComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgoffhandikcomponent) for the hand, and a barrel gets an [SKGMuzzleComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgmuzzlecomponent) . The optic, grip, and muzzle guides cover theirs. 4. Add slots of its own if things attach to it the same way as step 2. For reference, the handguard has top and bottom rails and the barrel has a muzzle slot. They register with the firearm's manager on their own. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-367fd94845920da7fad24ef518932b02b2ae36f9%252Fhandguard-components.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=58d49c10bd32aa595cb8e8606c7df274&sv=3) BP\_M4\_Handguard's components: its mesh, the top and bottom rail slots, and SKGOffHandIK for the hand ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-e9d4aa5e0a44a58d445e13ac52f0cdcd7ef5e90d%252Fbarrel-components.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=0871948ff09395b358a9a7ba2e4a91c7&sv=3) BP\_M4\_Barrel's components: its mesh, the SKGAttachment\_Muzzle slot for a muzzle device, and SKGMuzzle [PreviousSetting up a firearm](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-firearm) [NextGameplay tag attachment compatibility](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/gameplay-tag-attachment-compatibility) Last updated 6 days ago Was this helpful? --- # Setting up the animation blueprint | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-the-animation-blueprint.md) . The procedural animation (aiming, sway, lag, recoil, poses, firearm collision and so on) runs in an anim layer the plugin provides, AnimLayer\_SKGSF\_Procedurals in /All/Game/SKGSFCore/Animation/Layers/Procedural. You don't build or copy it. It's a template animation blueprint with no skeleton, so it works with your skeleton as is. Your own animation blueprint plays your animations, runs that layer on the upper body, and finishes with hand IK. AnimBP\_SKGSF\_PlayerPawn\_Template in SKGSFCore/Animation is set up this way. It's only there as a reference, which is why it's a template with no skeleton and doesn't depend on the mannequin. It comes into your project with SKGSFCore, as covered in [Project Setup](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/project-setup) , so you can open it, read its node settings, and copy and paste from it. You can also make a child of it for your skeleton if you want, like the example's AnimBP\_SKGSF\_PlayerPawn\_Manny in SKGSFExampleContent/Animation, which uses SK\_Mannequin and swaps in the example's locomotion animations. Set up the skeleton first, as covered in [Setting up a pawn](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-pawn) . The layer needs its virtual bones. 1\. Add the procedural layer to your animation blueprint[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-the-animation-blueprint#id-1.-add-the-procedural-layer-to-your-animation-blueprint) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 1. Open your animation blueprint, click Class Settings, and under Implemented Interfaces add ALI\_SKGSFExample. It's in /All/Game/SKGSFCore/Animation/Layers. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-86493986f811729990d762dc4c9750619ca248b8%252Fimplemented-interfaces.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=0095de7cff63be03a84a836c7893f1ad&sv=3) Class Settings > Interfaces > Implemented Interfaces with ALI SKGSFExample added 2. The SKGSFProcedurals layer now shows under Animation Layers in My Blueprint. Drag it into the AnimGraph. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-9c539563659b4d3b3942f37d7c41ea152c05b0d2%252Finterface.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=2b8bce5aaa47a8101353370282e07e5b&sv=3) SKGSFProcedurals under Animation Layers. SKGSFUpperBody is the example's own way of doing upper body animations, and isn't needed. 2\. Build the AnimGraph[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-the-animation-blueprint#id-2.-build-the-animgraph) ----------------------------------------------------------------------------------------------------------------------------------------------------- This is a simplified setup to get you started. Your AnimGraph doesn't have to look like this as the system is more flexible than shown here. Build it around your own animation needs such as adding your own layers, blends, or state machines. The one thing to keep is splitting the upper and lower body before the Copy Bone. The quickest start is to copy these nodes from AnimBP\_SKGSF\_PlayerPawn\_Template and paste them into your AnimGraph, or make a child of it and swap in your locomotion animations. A simple setup, in order: 1. **Your upper body pose**, such as an idle holding a rifle, then a **Slot** node so montages such as reloads play, into the **SKGSFProcedurals** layer. See [Performing animations](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/performing-animations) for montages. 2. **Layered blend per bone**, so locomotion drives the legs and the procedural animation drives the upper body. Set Blend Mode to Blend Mask and add the upper body mask from your skeleton to Blend Masks, such as UpperBodyLowerBodySplitMask. Turn on Mesh Space Rotation Blend. Plug your locomotion into Base Pose and the SKGSFProcedurals layer into Blend Poses 0. Do this split before the Copy Bone, or the blend mask causes problems with ik\_hand\_gun. The template has no skeleton, so it has no blend masks to pick from and its Blend Masks entry is left at None. Instead, its Layered blend per bone runs SetUpperBodyBlendMask as its On Initial Update function, which calls Set Blend Mask with Pose Index 0 and the name UpperBodyLowerBodySplitMask. Set Blend Mask finds the mask by that name on whatever skeleton is playing. That was the only way to keep it a template and remove its dependency on the mannequin. In your own animation blueprint, just pick your skeleton's mask in Blend Masks. If you make a child of the template, name your skeleton's blend mask UpperBodyLowerBodySplitMask so it's found. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-00a7b59112058631f0488568a2887da88bea14fa%252Flayered-blend.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=d4168ea8299f95bd1a33713d313e8a10&sv=3) The template's Layered blend per bone, with Locomotion in Base Pose, the procedural layer's output in Blend Poses 0, Blend Masks at None and SetUpperBodyBlendMask as On Initial Update ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-1bb9987d3c1f14841b220dfad1f0edd079037cfd%252Fset-blend-mask.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=438bbdd110771ba1c51a0cc67dbe7c9d&sv=3) SetUpperBodyBlendMask converts the node to a Layered Bone Blend and calls Set Blend Mask with UpperBodyLowerBodySplitMask on pose 0 3. **Copy Bone** from VB ik\_hand\_gun to ik\_hand\_gun, with Copy Translation and Copy Rotation on. This moves the held item to where the procedural animation put it. 4. **Two Bone IK** for each hand, so the hands follow the item: * IK Bone hand\_r, Effector Target ik\_hand\_r, Joint Target upperarm\_r. * IK Bone hand\_l, Effector Target ik\_hand\_l, Joint Target upperarm\_l. * On both, set Effector Location Space and Joint Target Location Space to Bone Space, and turn on Take Rotation from Effector Space. 5. Optional: a **Look At** on the head, to turn the head toward where the player looks while free looking. The example uses the Free Look Look At Location from `GetProceduralShooterPawnData` on the SKGShooterPawn component. 6. **Output Pose**. Unreal adds the Local To Component and Component To Local nodes between them for you. Turn the Copy Bone and Two Bone IK nodes off while nothing is held, so they don't move the hands when there's nothing to hold. The example sets their Alpha Input Type to Bool Value and plugs a Has Held Actor value into Enabled. You can get it from `GetProceduralShooterPawnData`. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-f16aa72b3d731b593766c58f98fd923aad3ebbde%252Fanim-graph.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=69e373dcd1b4c05da9d7836a7caa755f&sv=3) AnimBP\_SKGSF\_PlayerPawn\_Template's AnimGraph The Joint Target Location sets which way the elbows point. The example's values are good starting points: (X=-165.0, Y=160.0, Z=25.0) for hand\_r and (X=165.0, Y=-160.0, Z=25.0) for hand\_l. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-16f5f55affdc48c57350170f362b827bc048ca9e%252Ftwo-bone-ik.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=2a334309f15fea2e2206a0122712daa1&sv=3) The hand\_r and hand\_l Two Bone IK settings 3\. Link the layer[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-the-animation-blueprint#id-3.-link-the-layer) ------------------------------------------------------------------------------------------------------------------------------------------- The SKGSFProcedurals layer doesn't run until AnimLayer\_SKGSF\_Procedurals is linked to it. Either: * **Automatically**: On the pawn's [SKGShooterPawn component](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent) , set Linked Anim Layer Class to AnimLayer\_SKGSF\_Procedurals and turn on Auto Setup Linked Anim Layer. It links on BeginPlay. * **Yourself**: Call `LinkAnimLayerClass` or `LinkAnimLayerClassByInstance` on the SKGShooterPawn component, such as to switch layers while playing. The example's BP\_PlayerPawn binds the SKGShooterPawn component's [On Held Actor Set](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent#events) in SetupAnimationLinking. Its HeldActorChanged event then calls UnlinkHeldActor with the old actor and LinkHeldActor with the new one, which call `LinkAnimLayerClass`. For example, when a held actor is set such as a firearm being equipped (assuming you were holding nothing before), it unlinks the unarmed layer AnimLayer\_SKGSF\_Procedurals\_Unarmed and links the full procedural layer AnimLayer\_SKGSF\_Procedurals. When you drop that firearm, it unlinks the full procedural layer AnimLayer\_SKGSF\_Procedurals and links the unarmed layer AnimLayer\_SKGSF\_Procedurals\_Unarmed. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-6761fbae52ac65088f25f37add8c71f008ce4732%252Flink-layer.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=78d244678fd03daf95d70b5d540b2ce3&sv=3) BP\_PlayerPawn binds On Held Actor Set, then UnlinkHeldActor and LinkHeldActor swap the layers. The Link Anim Class Layers nodes are for the example's own upper body layers. Then set your pawn mesh's Anim Class to your animation blueprint, as in [Setting up a pawn](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-pawn) . [PreviousSetting up a pawn](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-pawn) [NextSetting up a firearm](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-firearm) Last updated 5 days ago Was this helpful? --- # Setting up night vision | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-night-vision.md) . This guide sets up helmet mounted night vision like the example's dual tube goggles BP\_NightVision. It uses the [SKGNightVisionComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgnightvisioncomponent) . How it works[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-night-vision#how-it-works) ------------------------------------------------------------------------------------------------------------------ The night vision image is two post process materials, PPM\_NightVision and PPM\_NVScintillation, on a Post Process component in the goggles. They're only added for the player wearing them. With the Mesh Visual Type, the image only shows through the lens mesh. The component puts a custom stencil on the lens and the post process only draws where it is, so you see night vision through the tubes and normal vision around them like real goggles. Overlay uses a texture mask on the screen instead, and Fullscreen covers the whole screen. Neither needs a lens mesh. The component handles the materials, gain, tube burn-in and the illuminator. Turning the goggles on and off and showing the image is done in your Blueprint. 1\. Meshes[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-night-vision#id-1.-meshes) ---------------------------------------------------------------------------------------------------------------- The example's goggles are two meshes in SKGSFCore/NightVision/DualTube: * SM\_NVG\_DualTube\_Housing, the body. * SM\_NVG\_DualTube\_Lens, the glass in front of each tube, with MI\_NVG\_DualTube (made from M\_GlassWithEyebox). The lens needs to be its own mesh so only it gets the stencil. Add a socket on the lens mesh at the center of each tube, S\_EyeboxLeft and S\_EyeboxRight in the example. Use one for a monocular such as a PVS-14, or four for panoramic such as GPNVGs. The component sends their positions to the lens material so each tube gets its own eyebox. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-88ca026808dcdfdba24289c75351d98b8535f557%252Flens-sockets.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=ab503c39009e00f4d5e58c428914f8e4&sv=3) The S\_EyeboxLeft and S\_EyeboxRight sockets on SM\_NVG\_DualTube\_Lens 2\. Night vision Blueprint[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-night-vision#id-2.-night-vision-blueprint) ------------------------------------------------------------------------------------------------------------------------------------------------ Create an Actor Blueprint and turn on Replicates. Add these components: * The housing mesh (Housing in the example), with the lens mesh (Tube) attached to it. * A **Spot Light** attached to the housing with the component tag Illuminator, for an infrared illuminator. Optional. * A **Post Process** component (PP\_NightVision). Leave Infinite Extent (Unbound) on. * An **SKGNightVision** component. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-c4936c64610b52f0f6ac690681ac3ff4c302769b%252Fcomponents.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=02a4c4030bde417e6d36cef896b36abd&sv=3) BP\_NightVision's components: the Tube lens and the SpotLight illuminator under the Housing mesh, PP\_NightVision and SKGNightVision ### SKGNightVision[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-night-vision#skgnightvision) Every setting is explained on the [SKGNightVisionComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgnightvisioncomponent) page. These are the ones to set. Under Tube Settings: * Set Night Vision Material to PPM\_NightVision and Night Vision Scintillation Material to PPM\_NVScintillation from SKGSFCore/Materials/PostProcess/NightVision. * Pick a Color, such as green or white phosphor, and set Gain and Max Gain. * Burn in Render Target Size makes bright lights streak and burn into the tubes, 1024 in the example. It renders an extra pass every frame while the tubes are on, so set it to 0 if you don't want burn-in. * IRLight Mask Render Target Size keeps infrared light inside the lens, 512 in the example. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-992bd9ca4865f25e0d3120d6cdb1092bc0fa68e9%252Ftube-settings.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=e95fa495e45ab8ee5cef0029ccaf179c&sv=3) BP\_NightVision's Tube Settings Under Housing Settings: * Leave Visual Type on Mesh. * Set Lens Mesh Name to the lens mesh, Tube in the example. * Add the lens sockets to Eyebox Center Locations, left first. * Leave Lens Stencil Value at 25. If something else in your project already uses 25, change it here and change NightVisionStencilValue in MPC\_SKGSF (SKGSFCore/Materials) to the same value. * Turn on Manual Gain so the player can change the gain, and set Gain Adjustment Step Amount. * For the illuminator, set Illuminator Light Component Tag to Illuminator, Infrared Light Function Material to M\_IRLightFunction, and add the brightness levels to Illuminator Brightness Settings. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-7fd6fbb03f01fb0abd64b0abd7ec0ae10ef913f0%252Fhousing-settings.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=ea28a85e6d5331db3a43845f18a79c11&sv=3) BP\_NightVision's Housing Settings The component turns on Render CustomDepth Pass on the lens mesh and sets its CustomDepth Stencil Value to Lens Stencil Value for you. It's the same as setting them on the mesh yourself, like on the example's Tube. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-fce826c33b6416ee68fbdd1a14b24ebba729c532%252Flens-stencil.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=85f644e6a775e573c56788c2e50aa4b3&sv=3) The Tube lens mesh with Render CustomDepth Pass on and a CustomDepth Stencil Value of 25 3\. Showing the image[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-night-vision#id-3.-showing-the-image) -------------------------------------------------------------------------------------------------------------------------------------- On Begin Play, BP\_NightVision checks that its owner is the local player. Then it calls `CreateAndSetupDynamicNightVisionMaterialInstance` and adds both materials it returns to PP\_NightVision as blendables with a weight of 0. This is only done for the local player because the Post Process component is unbound, so another player's goggles would otherwise put night vision on your screen. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-a2325c1a531bf7b268a12eaa03d60665e98d18e7%252Fblendables.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=b943ffa98a5673bf4550e0609aec9109&sv=3) BP\_NightVision adds both night vision materials to its PP Night Vision component with a weight of 0, only for the local player Bind On Tubes On State Changed on the [SKGNightVision](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgnightvisioncomponent) component. When the tubes turn on, set both blendables to a weight of 1, and back to 0 when they turn off. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-9d886741131348f416c053c0629bce13cb75c5c1%252Ftubes-on-state-changed.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=1cdf45e7858527e8eecc35d81c7a11fb&sv=3) BP\_NightVision setting the blendables' weight when the tubes turn on and off 4\. Flipping up and down[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-night-vision#id-4.-flipping-up-and-down) -------------------------------------------------------------------------------------------------------------------------------------------- The example's BP\_NightVision has FlipDown and FlipUp events. FlipDown calls `TurnTubesOn` and FlipUp calls `TurnTubesOff`. Both rotate the housing at Nods Flip Speed, FlipUp to Nods Up Rotation, and send bNodsDown to the server so other players see the goggles flip. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-c60d1dd297f8776e9f3419980b86cd3a478a3fca%252Fflip-events.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=443d0093547272c669bccb3a9d47eb09&sv=3) BP\_NightVision's FlipDown and FlipUp events turning the tubes on and off and sending the nods state to the server 5\. Pawn[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-night-vision#id-5.-pawn) ------------------------------------------------------------------------------------------------------------ The example's BP\_PlayerPawn spawns BP\_NightVision on the server on Begin Play with the pawn as its Owner and attaches it to NightVisionAttach which is a scene component on the pawn. The Owner has to be the pawn, both for the local player check in step 3 and so the client can call the flip's server event. Then it binds the inputs: * IA\_NightVision flips the goggles down and calls `EnableInfraredMode` on the SKG Infrared World Subsystem, then flips them up and calls `DisableInfraredMode` the next time. * IA\_NightVision\_IncreaseGain and IA\_NightVision\_DecreaseGain call `IncreaseGain` and `DecreaseGain` on the SKGNightVision component. `EnableInfraredMode` tells everything else that this player is using night vision. Lights and lasers in infrared mode, such as an [SKGLightLaserComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skglightlasercomponent) , only show while it's on, and magnified optics show the night vision image through the tubes. Call it on the local player only. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-a1623b524b4beaf29e2cb86a81834de4c8ab80dd%252Fpawn-inputs.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=e76b97eb8ef59d7791ea33763934640a&sv=3) BP\_PlayerPawn's IA\_NightVision flipping the goggles down with Enable Infrared Mode, and up with Disable Infrared Mode The illuminator is turned on and off with `TurnIlluminatorOn` and `TurnIlluminatorOff`, and `CycleIlluminatorBrightness` steps through its brightness levels. These can be called on the client and every player sees the change. Optics[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-night-vision#optics) ------------------------------------------------------------------------------------------------------ Magnified optics work through night vision without extra setup. Don't set an optic's Custom Depth Stencil Value to the Lens Stencil Value (25). Night Vision Light Transmission on the [SKGOpticComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent) sets how much light the scope lets through while night vision is on. For red dots, turn on Supports Night Vision on the SKGOptic and add Reticle Night Vision Brightness Settings, then call `ToggleReticleNightVisionSetting` so the reticle isn't blinding through the tubes. [PreviousSetting up a light and laser](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-light-and-laser) [NextHolding other items](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/holding-other-items) Last updated 6 days ago Was this helpful? --- # Performing animations | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/performing-animations.md) . Animations such as reloads are played as montages on the character's mesh with the procedural animation running on top of them. This guide uses the example's M4 reload: AM\_Character\_M4\_Reload on the character and AM\_M4\_Reload on the M4. How montages fit in[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/performing-animations#how-montages-fit-in) ------------------------------------------------------------------------------------------------------------------------------ In AnimBP\_SKGSF\_PlayerPawn\_Template, the upper body pose goes into a Slot node (DefaultSlot), then into the SKGSFProcedurals layer. Because the slot comes before the procedural layer, aiming, sway, recoil, poses and looking up and down are all applied on top of the montage. The firearm still aims and follows where you look while reloading. This is a simplified setup to get you started. Your AnimGraph doesn't have to look like this as the system is more flexible than shown here, such as using your own slots, slot groups or blends for different animations. Build it around your own animation needs. Montages that use DefaultSlot need no changes to the example's AnimBP. To use your own slot, the simplest place for it is the same spot, between your upper body pose and the SKGSFProcedurals layer. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-46956e709c333260e2d9672226361ccf6c56d2c9%252Fanim-graph-slot.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=c996959f8b904d00e96a43342aa85226&sv=3) The upper body pose going through the DefaultSlot Slot node into the SKGSFProcedurals layer 1\. Additive or not[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/performing-animations#id-1.-additive-or-not) -------------------------------------------------------------------------------------------------------------------------------- The example's montages are additive: the reload plays on top of the current upper body pose instead of replacing it, so one reload works from whatever idle the firearm uses. A non additive montage replaces the upper body pose while it plays, which also works with the slot above. If you're unfamiliar with additive animations, Unreal's documentation on them is worth a read. To make an animation additive, open the animation sequence, not the montage, such as AS\_Character\_M4\_Reload. Under Additive Settings: * Set Additive Anim Type to Mesh Space. * Set Base Pose Type to Frame from this animation and Ref Frame Index to 0, so the first frame of the reload is the pose everything else is added to. You can instead use Selected animation frame with your idle animation at frame 0. For a non additive animation, leave Additive Anim Type on No additive. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-684a68b737b89a01752538d47625c3a0fd570b8b%252Fadditive-settings.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=eef1b1412471878ad55a562e542d4132&sv=3) AS\_Character\_M4\_Reload's Additive Settings: Mesh Space, Frame from this animation, Ref Frame Index 0 An additive montage looks broken in the montage editor, since it's previewed on its own A pose. In the montage's Asset Details under Additive Settings, set Preview Base Pose to your idle, AS\_BasicRifleIdle in the example. This is only for previewing the montage in the editor. It has no effect on how the montage plays in game. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-8ddd5c10ce3b224f3a8152d04585fc2f59a85843%252Fpreview-base-pose.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=7e4ae048e28a395a4615ec58167a26b7&sv=3) AM\_Character\_M4\_Reload with AS\_BasicRifleIdle as its Preview Base Pose, used only for the editor preview 2\. Curves[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/performing-animations#id-2.-curves) -------------------------------------------------------------------------------------------------------------- The framework reads two curves from the animations playing on the character. Add them to the montage's curves, like on AM\_Character\_M4\_Reload: * **OffhandIKCurveAlpha**: Turns the offhand IK off, so the animation's own hand can let go of the firearm, such as to grab a magazine. 1 is off, 0 holds the handguard or grip as normal. The example's reload goes to 1 at the start and back to 0 at the end. * **AimCurveAlpha**: How much of the montage's firearm rotation still shows while aiming. 0 keeps the sights locked on target, higher lets the animation tilt the firearm while aiming. The example's reload uses 0.1 in the middle, so a little of the reload shows while aiming. The curve names can be changed with Offhand IKCurve Name and Aim Curve Name in your AnimBP's Class Defaults. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-aaa6651ecda8f6fa8ab95f023f9a8f4e425e3475%252Fmontage-curves.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=3007be9356a9ab82dac2e0823a3c5925&sv=3) AM\_Character\_M4\_Reload's AimCurveAlpha (top), peaking around 0.1, and OffhandIKCurveAlpha (bottom), at 1 for most of the reload 3\. Play the montage[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/performing-animations#id-3.-play-the-montage) ---------------------------------------------------------------------------------------------------------------------------------- Play the character's montage on the pawn's mesh, and the firearm's own montage on the firearm's mesh if it has one. The example's BP\_Firearm does this in PerformReload with its ReloadMontageSet, which holds a Pawn montage and an Item montage. It gets its owner as a Character and plays the Pawn montage on its Mesh, then plays the Item montage on the Firearm Mesh Component. When the firearm's montage completes, it sets Is Reloading back to false. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-7949553e7f55cb7efe170a038968477d251407d1%252Fplay-reload.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=0d35dd99efee8d450b85d0d1b0884186&sv=3) BP\_Firearm's PerformReload playing the Pawn montage on the character's Mesh and the Item montage on the Firearm Mesh Component [PreviousCreating a custom pose](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/creating-a-custom-pose) [NextSKGAttachmentComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentcomponent) Last updated 5 days ago Was this helpful? --- # Holding other items | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/holding-other-items.md) . The framework isn't only for firearms. Anything you hold with an [SKGProceduralAnimComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent) gets the procedural animation, such as sway, lag, deadzone, aiming and poses. This page goes over the example's BP\_Held\_Flashlight, a one handed flashlight with a light and laser. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-05281718a776ecf41c795c7a8af6f8d405f62fb5%252Fheld.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=9dc06072f9d744edf13154d018307159&sv=3) Holding BP\_Held\_Flashlight with its light and laser on How it differs from a firearm[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/holding-other-items#how-it-differs-from-a-firearm) ------------------------------------------------------------------------------------------------------------------------------------------------ When the held item has no [SKGFirearmComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent) , the [SKGShooterPawnComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent) uses the item's own SKGProceduralAnim component for all of its settings, and its own [SKGOffhandIKComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgoffhandikcomponent) if it has one. You can even put a [SKGProceduralAnimComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent) on your pawn specifying your pawn mesh and have it apply directly to your hands. Anything that comes from the SKGFirearm component isn't used, such as attachments, firearm collision. The SKGShooterPawn component has getters such as `GetCurrentLightLaserComponents` which in this case is used to call the functions to turn the light and laser on and off. The Blueprint[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/holding-other-items#the-blueprint) ---------------------------------------------------------------------------------------------------------------- BP\_Held\_Flashlight is an Actor Blueprint with Replicates on and these components: * The mesh. It has an S\_Aim socket for aiming placed the same way as on a sight. See [Setting up a red dot](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-red-dot) . * A **SKGProceduralAnim** component with Procedural Mesh Name set to the mesh. Procedural Aim Socket Names already holds S\_Aim. Its sway, lag, deadzone, aiming and pose settings all apply to the flashlight. * The light and laser with an **SKGLightLaser** component, set up the same way as on a light and laser attachment. See [Setting up a light and laser](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-light-and-laser) . ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-ed39cb6be8e45914c4c9dd7a21c7b6e70bb0ab42%252Fcomponents.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=be0c15e5a61b919bf85d4087a7228bb1&sv=3) BP\_Held\_Flashlight's components Holding it[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/holding-other-items#holding-it) ---------------------------------------------------------------------------------------------------------- Hold it the same way as a firearm. Call `SetHeldActor` on the SKGShooterPawn component on the server, then attach the flashlight to the pawn's mesh at ik\_hand\_gun. See the Holding something section in [Setting up a pawn](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-pawn) . Aiming works the same as a firearm too, lining S\_Aim up with the camera. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-e5f173ed10f5b8365b34cef6eced6e64747eb120%252Faiming.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=b9809778419873e6a908f4998197ae98&sv=3) Aiming BP\_Held\_Flashlight Turning the light and laser on and off[](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/holding-other-items#turning-the-light-and-laser-on-and-off) ------------------------------------------------------------------------------------------------------------------------------------------------------------------ `GetCurrentLightLaserComponents` on the SKGShooterPawn component returns the light laser components of what you're holding, either the firearm's from its attachments or the held item's own. The example flips between `TurnLightOn` and `TurnLightOff` on each of them for the light, and `TurnLaserOn` and `TurnLaserOff` for the laser. These can be called on the client, and every player sees the change. See [SKGLightLaserComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skglightlasercomponent#functions) for its other functions and how to setup the component. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-5952b5bdbfcbf04e238c4808dea156b42e703217%252Ftoggle-light-laser.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=ca8f4616114cc8d63ca93ec6c31db170&sv=3) BP\_PlayerPawn toggling the laser and light on whatever it's holding [PreviousSetting up night vision](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-night-vision) [NextCreating a custom pose](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/creating-a-custom-pose) Last updated 6 days ago Was this helpful? --- # SKGAttachmentComponent | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentcomponent.md) . This component is optional. You can use your own attachment system instead and call `AddAttachment` and `RemoveAttachment` on the [SKGFirearmComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent) whenever an attachment is added or removed. A slot that holds one attachment, such as the optic slot on a rifle or the handguard slot on an upper receiver. Add one for each attachment point on your Blueprint. It spawns, attaches and replicates the attachment, controls which attachments are allowed, and can slide the attachment along a rail. See [Setting up attachments](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-attachments) for a step by step setup. Attachment components register with the [SKGAttachmentManagerComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentmanagercomponent) on the same actor or any actor it's attached to, such as the firearm. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-a8af6492cebee2bd1e1a77543e12afce66487d40%252Fdetails-panel.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=59527789463ba49f4e4a84fd4eaf2fd1&sv=3) The M4's optic slot in the Details panel Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentcomponent#settings) ------------------------------------------------------------------------------------------------------- ### Initialize[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentcomponent#initialize) * **Attach to Mesh Name**: Name of the mesh component the attachment attaches to. * **Attach to Socket**: Socket on that mesh the attachment attaches to. * **Component Name**: Optional name for this slot, such as Sights. Useful for customization menus. * **Component Image**: Optional icon for this slot. Useful for customization menus. * **Auto Call Force Net Update**: Forces a network update whenever the attachment or offset changes. Useful if the actor's Net Update Frequency is very low. * **Gameplay Tags**: Tags you can use to identify this slot in your own logic. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-026c5ad2ce42a3ac2829ddac6ae94c2b38d6c567%252Fattach-to-socket.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=5b45e203eaac22f43726db18778c94b9&sv=3) The S\_Attachment\_Optic socket on the M4, used by its optic slot ### Attachment[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentcomponent#attachment) * **Is Required to Function**: Marks the slot as essential, such as a barrel or handguard. The example's customization menu uses this to stop these from being removed. * **Auto Set Leader Pose Component**: For attaching skeletal meshes to a character, such as clothing. The attachment's mesh follows the character's animation. * **Leader Pose Attachment Mesh Name**: Name of the skeletal mesh on the attachment that follows the character. * **Random Default Attachment**: Spawns a random compatible attachment at start instead of Default Attachment. Uses Compatible Attachments. * **Default Attachment**: The attachment spawned at start. Only spawns if an SKGAttachmentManagerComponent is found. #### Compatibility[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentcomponent#compatibility) Controls which attachments this slot accepts. There are two ways to do it. * **Use Legacy Attachment System**: On uses Compatible Attachments. Off uses gameplay tags. * **Compatible Attachments**: Data assets that list the allowed attachment classes. Leave empty to allow any attachment. * **Slot Tag**: Gameplay tag compatibility. The tag for this slot, looked up in the Slot Compatibility Table List in the attachment developer settings. Attachments whose gameplay tags match that slot's query are allowed. * **Slot Compatibility Override**: Used when Slot Tag is empty. Sets the slot tag and query directly on this component. Gameplay tag compatibility needs attachments that have gameplay tags, such as Blueprints based on SKGBaseActor or its child classes. See [Gameplay tag attachment compatibility](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/gameplay-tag-attachment-compatibility) . ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-662ec4b5693a4acea63d25cebb6aeaef599a62a7%252Fcompatible-attachments.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=6717d1d3fddb9ec9324063a283f77535&sv=3) A compatibility data asset listing the attachments allowed in the M4's optic slot #### Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentcomponent#settings-1) * **Allow Client Side Modification**: Lets clients add, remove and move attachments. If off, only the server can, and a client that tries anyway is disconnected. **Offset Settings** Lets the attachment slide along a rail, along the mesh's forward axis. * **Use Offset System**: Turn off if this slot never moves its attachment such as a barrel. * **Replicate Offset Each Change**: Replicates every offset change. If off, you must call `FinalizeAttachmentOffset` when the player is done moving the attachment in order for it to replicate. * **Offset Snap Distance**: Spacing between rail slots, in cm. 1.046 for Picatinny, 4.0 for M-LOK, 2.0 for KeyMod. * **Minimum Offset Allowed** / **Maximum Offset Allowed**: How far the attachment can move back and forward from the socket, in cm. Rounded to the snap distance. * **Default Attachment Offset**: Where the attachment starts. **Attachment Rules** How the attachment is attached to the socket. The defaults work for most attachments. * **Attach Location Rule** / **Attach Rotation Rule** / **Attach Scale Rule**: Same as Unreal's attachment rules. * **Weld Simulated Bodies**: Same as Unreal's Weld Simulated Bodies. Functions[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentcomponent#functions) --------------------------------------------------------------------------------------------------------- Changes made on a client are sent to the server when Allow Client Side Modification is on. ### Attachment[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentcomponent#attachment-1) * **TryLoadSetupAttachment**: Loads the attachment class in the background, then spawns and attaches it. * **TrySetupAttachment**: Spawns and attaches the attachment class. * **TrySetupExistingAttachment**: Sets up an actor that already exists as the attachment in the slot with an optional attach. * **TryLoadSetupAttachmentWithData** / **TrySetupAttachmentWithData**: Same as above, but builds the attachment from a data asset. See [Data Assets](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/data-assets) . * **RemoveAttachment**: Removes the attachment from the slot without destroying it, such as when dropping it or moving it to an inventory. Returns the removed attachment. * **DestroyAttachment**: Removes and destroys the attachment, along with anything attached to it. * **HasAttachment**: True if the slot has an attachment. Remove or destroy the current attachment before setting up a new one. ### Compatibility[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentcomponent#compatibility-1) * **IsAttachmentClassCompatible** / **IsAttachmentCompatible**: True if the class or object is allowed in this slot. Both can be overridden in Blueprint. * **GetCompatibleAttachments**: The attachment classes from Compatible Attachments. * **GetCompatibleAttachmentsFromPrimaryAssets**: Every data asset allowed by gameplay tag compatibility, from the Asset Types in the attachment developer settings. * **GetUsesLegacyAttachmentCompatibilitySystem**: True if Use Legacy Attachment System is on. ### Preview[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentcomponent#preview) Shows an attachment only on the local machine, such as when hovering over it in a customization menu. The current attachment is hidden while a preview is shown. * **TryLoadSetupPreviewAttachment** / **SetupPreviewAttachment**: Shows a preview of the attachment class. * **TryLoadSetupPreviewAttachmentWithData** / **SetupPreviewAttachmentWithData**: Shows a preview built from a data asset. * **DestroyPreviewAttachment**: Removes the preview and shows the current attachment again. ### Offset[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentcomponent#offset) * **SetAttachmentOffset**: Moves the attachment to an offset, snapped and clamped to the Offset Settings. * **IncrementOffset** / **DecrementOffset**: Moves the attachment forward or back one rail slot. * **FinalizeAttachmentOffset**: Replicates the current offset. Needed when Replicate Offset Each Change is off. * **CanAttachmentBeOffset**: True if the minimum and maximum offset are different. * **GetAttachTransform**: World transform of the socket. * **GetAttachOffsetTransform**: World transform of the socket with the current offset applied. * **GetAttachStartTransform** / **GetAttachEndTransform**: World transform at the minimum and maximum offset. * **GetAttachSnapPoints**: World locations of every rail slot between the minimum and maximum offset. ### Getters[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentcomponent#getters) * **GetAttachment**: The current attachment. * **GetAttachmentOffset**: The current offset. * **GetAttachToSocket** / **GetComponentName** / **GetComponentImage** / **GetDefaultAttachment** / **GetIsRequiredToFunction** / **GetOffsetSettings**: Return the matching setting. Events[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentcomponent#events) --------------------------------------------------------------------------------------------------- * **On Attachment Added** / **On Attachment Removed**: When an attachment is added or removed. Fires on the server and clients. * **On Attachment Changed**: Any time an attachment is added or removed. Fires on the server and clients. * **On Attachment Destroyed**: Right before the attachment is destroyed. Server only. * **On Offset Changed**: When the offset changes. Fires on the server and clients. * **On Preview Attachment Added** / **On Preview Attachment Removed**: When a preview is shown or removed. Local only. [PreviousPerforming animations](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/performing-animations) [NextSKGAttachmentManagerComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentmanagercomponent) Last updated 6 days ago Was this helpful? --- # SKGAttachmentManagerComponent | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentmanagercomponent.md) . This component is optional. You can use your own attachment system instead and call `AddAttachment` and `RemoveAttachment` on the [SKGFirearmComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent) whenever an attachment is added or removed. Keeps track of every [SKGAttachmentComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentcomponent) and attachment on an actor, including slots that come with an attachment, such as the rail slots on a handguard. Add one to the root actor, such as the firearm. It gives you one place to find slots and attachments, hide them, and listen for changes. See [Setting up attachments](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-attachments) for a step by step setup. Set **Attachment Manager Component Name** on the [SKGFirearmComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent) to this component's name, and the firearm adds and removes attachments for you. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-95b787182b1554f244b34d9394628fd549647c66%252Ffirearm-manager-name.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=0f51e0faec6368d08b6006e41ea47778&sv=3) BP\_BoltGun's SKGFirearm pointing to its SKGAttachmentManager component Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentmanagercomponent#settings) -------------------------------------------------------------------------------------------------------------- ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-659d37f593fda0dc94c0c3803efd23c525839a7e%252Fdetails-panel.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=7e0261d7b09733eee8ad2fd7f7edd855&sv=3) The attachment manager's Initialize settings ### Initialize[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentmanagercomponent#initialize) * **Manager Name**: Optional name for this manager. The example's customization menu uses it as the folder name for saved presets. * **Allow Client Side Modification**: Lets clients hide, unhide and change collision on all attachments. If off, only the server can, and a client that tries anyway is disconnected. * **Auto Call Force Net Update**: Forces a network update whenever a slot or attachment is added or removed, or the hidden or collision state changes. Useful if the actor's Net Update Frequency is very low. * **Gameplay Tags**: Tags you can use to identify this manager in your own logic. Functions[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentmanagercomponent#functions) ---------------------------------------------------------------------------------------------------------------- ### Attachments[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentmanagercomponent#attachments) * **GetAttachmentComponents**: Every slot on the actor. Break each item to get its Attachment Component. * **GetAttachments**: Every attachment on the actor. * **GetAttachmentComponentWithAttachment**: The slot holding the given attachment. * **GetCompatibleAttachmentComponentsFromObject** / **GetCompatibleAttachmentComponentsFromClass** / **GetCompatibleAttachmentComponentsFromConstructionDataAsset**: Every slot that accepts the given attachment, class or data asset. Returns true if at least one is found. Useful for showing where an attachment can go in a customization menu. * **GetAttachmentComponentWithTag**: The first slot with the gameplay tag in its Gameplay Tags. * **GetAttachmentComponentWithQuery** / **GetAttachmentComponentsWithQuery**: The first slot, or every slot, whose Gameplay Tags match the query. * **GetAttachmentComponentWithSlotTag**: The slot whose Slot Tag matches. See [Compatibility](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentcomponent#compatibility) . * **GetAttachmentWithTag**: The first attachment with the gameplay tag, such as the first optic. This requires the attachments to have implemented the gameplay tags interface, such as Blueprints based on SKGBaseActor. ### Attachment State[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentmanagercomponent#attachment-state) These apply to every attachment, including ones added later. Changes made on a client are sent to the server when Allow Client Side Modification is on. * **HideAllAttachments** / **UnhideAllAttachments**: Hides or shows every attachment. * **DisableCollisionAllAttachments** / **EnableCollisionAllAttachments**: Turns collision off or on for every attachment. * **DestroyAllAttachments**: Destroys every attachment. Include Self also destroys the actor that owns the manager. ### Registering[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentmanagercomponent#registering) For an attachment that isn't in an SKGAttachmentComponent, such as one you attach yourself. Server only. * **RegisterAttachmentComponentsAttachmentNoComponent**: Adds the actor to the manager's attachments. It's then included in GetAttachments, the attachment state functions and the events, and the SKGFirearmComponent picks it up like any other attachment. * **UnregisterAttachmentComponentsAttachmentNoComponent**: Removes it again. ### Getters[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentmanagercomponent#getters) * **GetManagerName**: Returns Manager Name. ### Other[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentmanagercomponent#other) These are in the SKGAttachmentHelpers library. * **GetAttachmentManagerComponent**: Finds the SKGAttachmentManagerComponent on an actor. #### Saving and loading builds[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentmanagercomponent#saving-and-loading-builds) Saves which attachment is in which slot, along with its offset, so a build can be rebuilt later, such as a preset in a customization menu. Slots are matched by their component name, so renaming a slot breaks builds saved before the rename. * **ConstructAttachmentManagerData**: Builds the save data from the manager: the actor's class, and the class, slot and offset of every attachment. * **SerializeAttachmentManagerToJson** / **DeserializeAttachmentManagerJson**: Turns the save data into a JSON string and back, for saving to a file or sending over the network. * **ConstructActorFromAttachmentManagerData**: Spawns the actor and sets up the saved attachments in place of its default attachments. * **ConstructExistingActorFromAttachmentManagerData**: Replaces the attachments on an existing actor with the saved ones. Events[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentmanagercomponent#events) ---------------------------------------------------------------------------------------------------------- * **On Attachment Components Changed**: When a slot is added or removed. Fires on the server and clients. * **On Attachments Changed**: When an attachment is added or removed. Fires on the server and clients. * **On Attachment Component Added** / **On Attachment Component Removed**: Same as On Attachment Components Changed, but passes the slot. * **On Attachment Component Attachment Added** / **On Attachment Component Attachment Removed**: Same as On Attachments Changed, but passes the attachment. [PreviousSKGAttachmentComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentcomponent) [NextSKGCharacterMovementComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgcharactermovementcomponent) Last updated 6 days ago Was this helpful? --- # SKGCharacterMovementComponent | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgcharactermovementcomponent.md) . This component is optional. It's a Character Movement component with sprinting built in. Sprinting is predicted, so it works in multiplayer without the player snapping back. It only works on a Character. Other pawns, such as ones using the General Movement Component or Mover, handle sprinting themselves. To use it, open your Character Blueprint, select the Character Movement component, and set Component Class in the Variable section to SKGCharacterMovementComponent. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-dbbe1f88b6b519ae023a64fc65fb37aba43d7f05%252Fcomponent-class.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=9afc867e8fb638cffa4461044908f80c&sv=3) BP\_PlayerPawn's Character Movement component, with Component Class set to SKGCharacterMovementComponent It also changes a few of Character Movement's defaults: Max Walk Speed 150, Max Walk Speed Crouched 75, Max Acceleration 1365 and Braking Friction 1. Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgcharactermovementcomponent#settings) -------------------------------------------------------------------------------------------------------------- ### Sprint[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgcharactermovementcomponent#sprint) ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-6045d44053fa6ba1fe4eccccb01f8da4b7578665%252Fsprint-settings.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=5716280bb3e082ed3e6c30fb60750c9c&sv=3) BP\_PlayerPawn's Sprint settings * **Max Sprint Speed**: Speed in cm/s while sprinting, 350 in the example. * **Sprint Angle Tolerance**: How close to forward the player must move to sprint, from -1 to 1. The default 0.25 allows up to about 75 degrees off forward. Higher is stricter. * **Only Allow Forward Sprint**: Only sprints while moving forward within Sprint Angle Tolerance. Off lets the player sprint in any direction. Functions[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgcharactermovementcomponent#functions) ---------------------------------------------------------------------------------------------------------------- ### Sprint[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgcharactermovementcomponent#sprint-1) * **StartSprinting** / **StopSprinting**: Starts or stops sprinting. Call them on the player's own machine, such as from input. The movement is sent to the server for you. * **GetWantsToSprint**: True between StartSprinting and StopSprinting, even if the player isn't sprinting yet. * **AreSprintingConditionsMet**: True while the player is actually sprinting. Crouching stops the sprint until the player stands. * **IsVelocityWithinSprintAngleTolerance**: True if the player is moving forward within Sprint Angle Tolerance. [PreviousSKGAttachmentManagerComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentmanagercomponent) [NextSKGFirearmAttachmentStatComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmattachmentstatcomponent) Last updated 5 days ago Was this helpful? --- # SKGFirearmAttachmentStatComponent | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmattachmentstatcomponent.md) . This component is optional. It gives an attachment stats, such as a suppressor adding weight and cutting recoil. Add one to each attachment actor that should change the firearm's stats. When the attachment is added, the [SKGFirearmComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent) applies its stats on top of the firearm's Firearm Stat Settings, and takes them back off when the attachment is removed. The framework doesn't use the stats itself. Read the totals with `GetFirearmStats` on the SKGFirearmComponent for your own gameplay and UI, such as a stats screen. To change how the stats are applied, override `AddFirearmAttachmentStats` and `RemoveFirearmAttachmentStats` in a Blueprint child of the SKGFirearmComponent. Set everything on the component and leave the Data Asset field empty. Using data assets as templates is covered in [Data Assets](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/data-assets) . Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmattachmentstatcomponent#settings) ------------------------------------------------------------------------------------------------------------------ ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-275d399119034763ff9402390e1da92c8188937c%252Fdetails-panel.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=f2eb2531f065519dabb4b4f8962aa422&sv=3) The SKGFirearmAttachmentStat component's settings, all at their defaults ### Initialize[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmattachmentstatcomponent#initialize) * **Attachment Stats Data Asset**: Leave empty and use Attachment Stats. * **Gameplay Tags**: Tags you can use to identify this component in your own logic. #### Attachment Stats[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmattachmentstatcomponent#attachment-stats) * **Weight** / **Ergonomics**: Added to the firearm's. Use a negative value to lower them. * **Accuracy**: Added to the firearm's accuracy in MOA. Lower is more accurate, so -0.5 tightens the spread. * **Vertical Recoil** / **Horizontal Recoil**: Percent change to the firearm's recoil. -20 cuts it by 20%. Each attachment's change multiplies the last, so two -20 attachments leave 64% of the recoil, not 60%. * **Muzzle Velocity Percentage**: Percent change to muzzle velocity, such as a longer barrel adding 10. * **Fire Rate Change Percent**: Percent change to the firearm's fire rate in rounds per minute. 10 fires 10% faster. Functions[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmattachmentstatcomponent#functions) -------------------------------------------------------------------------------------------------------------------- ### Stats[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmattachmentstatcomponent#stats) * **GetAttachmentStats**: The stats from the data asset if one is set, otherwise Attachment Stats. * **SetAttachmentStats**: Replaces the stats and clears the data asset. A firearm the attachment is already on updates its totals. Call on the server. ### Other[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmattachmentstatcomponent#other) * **GetFirearmAttachmentStatComponent**: Returns the SKGFirearmAttachmentStatComponent on an actor. [PreviousSKGCharacterMovementComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgcharactermovementcomponent) [NextSKGFirearmComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent) Last updated 5 days ago Was this helpful? --- # SKGShooterPawnComponent | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent.md) . Connects your pawn to the rest of the framework. Add one to every pawn that holds items, such as your player character. It finds the pawn's meshes and camera by name, links the procedural anim layer, and keeps track of the held actor. Aiming, leaning, free look, poses and recoil all go through it. Call `SetHeldActor` on the server when the player equips something, such as a firearm. See [Setting up a pawn](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-pawn) for the full pawn setup. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-267610a4288f2e6f37d3ce59d72be0a60be81394%252Fcomponents.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=6a01cd5f71d43d1ab32e3da7bf70c6f4&sv=3) BP\_PlayerPawn's components. The SKGShooterPawn component finds Mesh (CharacterMesh0) and Camera by name Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent#settings) -------------------------------------------------------------------------------------------------------- ### Initialize[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent#initialize) ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-71aef927935f638703cf34686768d44e29208623%252Finitialize.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=df68bf5c4090480781a056556bbc6489&sv=3) The SKGShooterPawn component's Initialize settings on BP\_PlayerPawn * **Using Legacy Input Scales**: Match this to Enable Legacy Input Scales in Project Settings > Input, so free look knows which way is up. It's on in the example project. * **Linked Anim Layer Class**: The anim layer that runs the procedural animation, a child of SKGShooterFrameworkAnimInstance such as AnimLayer\_SKGSF\_Procedurals. See [Setting up the animation blueprint](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-the-animation-blueprint) . Leave empty if you link it yourself with `LinkAnimLayerClass` or `LinkAnimLayerClassByInstance`, like the example's BP\_PlayerPawn does. * **Auto Setup Linked Anim Layer**: Links the Linked Anim Layer Class on BeginPlay. With no class set, it uses the mesh's own anim BP instead, which must then be a child of SKGShooterFrameworkAnimInstance. Off in the example. * **Use Single Mesh**: Uses one mesh for both first and third person, such as true first person. Only one of the two mesh names needs to match. On in the example, with both mesh names set to CharacterMesh0. * **Third Person Mesh Component Name** / **First Person Mesh Component Name**: Names of the pawn's skeletal meshes. A Character's mesh is CharacterMesh0. The local player uses the first person mesh and other players see the third person mesh. If a mesh isn't found, the game crashes on BeginPlay with a message naming the setting. * **Camera Component Name**: Name of the pawn's Camera or Gameplay Camera component. Aiming lines up the sight with the camera using its position relative to the mesh's head bone, so the mesh needs a bone named head. The camera's field of view on BeginPlay is the one aiming zooms in from. * **Camera Attached Socket**: The camera socket on the head, S\_Camera in the example. Used to line up aiming when no camera is found. * **Constantly Update Camera Offset**: Updates the camera's position relative to the head every frame, such as when head animations move the camera. Leave off if the camera doesn't move. In the example, the camera is attached to S\_Camera and follows the head without animation. * **Replicate Remote Yaw**: Sends the player's look yaw to other players. Unreal only sends the pitch, so this is needed for free look and turn in place to show on other players' screens. If you don't need free look and have another solution (or do not want) for turn in place, disable this. * **Remote Yaw Replication Rate**: Seconds between yaw updates. 0 sends it every frame. 0.033333 in the example, about 30 times a second. * **Gameplay Tags**: Tags you can use to identify this component in your own logic. ### FreeLook[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent#freelook) Free look lets the player look around without turning the body or the firearm, such as while holding Alt. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-997c0e332f055460e38cd06942e988ad54e638d3%252Ffree-look-leaning.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=79801ffb02fe155cb9674cd6b9f307c3&sv=3) BP\_PlayerPawn's FreeLook and Leaning settings #### Free Look Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent#free-look-settings) * **Auto Set Use Controller Rotation Yaw**: Turns off the pawn's Use Controller Rotation Yaw while free looking so the body doesn't turn, and turns it back on after. * **Max Pitch Up** / **Max Pitch Down** / **Max Yaw Left** / **Max Yaw Right**: How far in degrees the player can look from where free look started. ### Leaning[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent#leaning) Leaning tilts the spine left and right with `Lean`. #### Lean Left Right Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent#lean-left-right-settings) * **Use Spring Interp**: Uses a spring for the lean, so it can overshoot and settle. Off uses Interp Speed. * **Stiffness** / **Critical Damping Factor** / **Mass** / **Target Velocity Amount**: The spring's settings. Higher Stiffness leans faster, and a lower Critical Damping Factor bounces more. * **Interp Speed**: How fast the lean moves when Use Spring Interp is off. * **Max Lean Angle**: The lean in degrees at full lean, 35 in the example. Up to 90. ### Debug[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent#debug) Shown in the SKGShooter Framework section, above the component's other settings. Editor only, for firearm collision. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-c31160415082ebe41eaeec2a9dccf86981e064ac%252Fdebug.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=8e5e607a4ccf2b56f0b5fbe733e80ebb&sv=3) The Debug settings * **Print Hit**: Logs what firearm collision hits to the Output Log. * **Draw Debug Trace**: Draws the firearm collision trace in red. Functions[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent#functions) ---------------------------------------------------------------------------------------------------------- Aiming, leaning, free look, poses and switching hands is predicted and called on the client. The change is sent to the server and every player sees it. ### Held Actor[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent#held-actor) * **SetHeldActor**: Call on the server when the player equips something, such as a firearm. It replicates to every player. A firearm is driven by its [SKGFirearmComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent) . Anything else uses its own [SKGProceduralAnimComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent) and [SKGOffhandIKComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgoffhandikcomponent) . * **ClearHeldActor**: Call on the server when the player drops or puts away the held actor. With nothing held, an [SKGProceduralAnimComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent) on the pawn itself is used, such as for fists. * **GetHeldActor**: The actor being held. ### Aiming[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent#aiming) * **StartAiming** / **StopAiming**: Starts or stops aiming with the held actor. StartAiming does nothing if the held actor's Can Aim is off. * **StartAimingAI** / **StopAimingAI**: For AI pawns on the server. Sets aiming without the optic or Can Aim checks. Calls on a client do nothing. * **IsAiming**: True while aiming. * **GetAimPercentage**: How far into aiming the animation is, from 0 (not aiming) to 1 (fully aimed). ### Free Look[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent#free-look) * **StartFreeLook** / **StopFreeLook**: Starts or stops free look. StopFreeLook turns the view back to where free look started. * **IsFreeLooking**: True while free looking. * **SetMouseInput**: Pass your look input here each time you get it. Free look uses it for its limits, and deadzone uses it to move the firearm. * **CanAddYaw** / **CanAddPitch**: False once free look reaches a limit in that direction. Don't add look input in that direction while it's false. ### Leaning[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent#leaning-1) * **Lean**: Leans toward a target from -1 to 1, as a fraction of Max Lean Angle. 0 stands back up and 0.5 leans halfway. * **GetTargetLeanAngle**: The angle in degrees being leaned toward. * **GetCurrentLeanAngle**: The angle the animation is at right now. ### Procedural Animation[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent#procedural-animation) * **PerformProceduralRecoil**: Plays recoil from the [SKGProceduralAnimComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent) 's Recoil Settings. Only plays on the machine that calls it so you will want to call this on replication locally for remote clients. The multipliers scale the control rotation, location and rotation recoil, such as less recoil while crouched. * **PerformProceduralPose**: Plays a pose from the held item's Pose Settings by its Curve Tag, such as high ready, low ready, short stock, etc. With Exit Pose on, it plays the pose's From Curve to go back to normal. See [Creating a custom pose](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/creating-a-custom-pose) . * **PerformCustomCurve**: Plays a one-off curve, such as a bump when walking into a wall. Its Replication Settings choose whether other players see it. * **GetProceduralPoseData**: Returns a pose's curves by its Curve Tag. * **GetCurrentProceduralPoseReplicationData**: The last pose played and whether it was the exit. * **SetSwayMultiplier**: Replaces the sway multiplier, such as higher while injured or lower such as 0.25f while holding breath. Only changes it on the local machine. * **ResetSwayMultiplier**: Goes back to the sway settings' own multiplier. * **GetUsingCustomSwayMultiplier**: True after SetSwayMultiplier until ResetSwayMultiplier. * **SetUseFirstPersonProceduralsAsLocal** / **SetUseThirdPersonProceduralsAsLocal**: Which procedural settings the local player uses. First person is the default. Switch to third person for a third person camera. * **IsUsingFirstPersonProceduralsAsLocal**: True if the local player uses the first person settings. * **IsThirdPerson**: True for other players, or when the local player uses the third person settings. ### Hands[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent#hands) Right-handed is the default, with the offhand on the left. * **SetOffhandIKToRightHand**: Switches to left-handed mode with the offhand being the right hand. Only works if the firearm's Can Use Left Hand Dominate is on. * **SetOffhandIKToLeftHand**: Switches back to right-handed. * **GetOffhandIKIsLeftHand**: True when right-handed. ### Firearm Collision[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent#firearm-collision) Firearm collision pushes the firearm back when it's close to a wall. Its settings are on the [SKGFirearmComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent) . * **GetFirearmCollisionPushAmount**: How far firearm collision is pushing the firearm back. 0 when nothing is in the way. * **EnableFirearmCollisionDisableOverride** / **ClearFirearmCollisionDisableOverride**: Turns firearm collision off, or back to the firearm's setting, such as during a cutscene. * **GetFirearmCollisionDisableOverride**: True while firearm collision is turned off this way. ### Camera[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent#camera) While aiming, the component zooms the Camera component's field of view by the [SKGProceduralAnimComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent) 's Camera Zoom Percentage, or to the optic's magnification in Normal mode. This can be turned off in the Camera section of [Developer Settings](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings) . * **SetCameraDefaultFOV**: Sets the field of view aiming zooms in from. Call it when the player changes their field of view setting. * **GetDesiredCameraFOV**: The field of view the camera is moving toward, for your own camera system. ### Optics and Sensitivity[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent#optics-and-sensitivity) Magnified Optic Mode and Monitor Distance Coefficient are stored per player in the SKGShooterLocalPlayerSubsystem, but aren't saved, so set them from your settings menu and save them in your game user settings. * **SetMagnifiedOpticMode** / **GetMagnifiedOpticMode**: Picture in Picture or Normal (traditional camera zoom) for magnified optics. See [SKGOpticComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent) . * **SetMonitorDistanceCoefficient** / **GetMonitorDistanceCoefficient**: How much aim sensitivity drops as you zoom in. 0 divides it by the zoom, so a 4x scope gets a quarter. Higher values lower it less. 1.33 by default. * **GetMagnificationSensitivityMultiplier**: Multiply your look input by this while aiming so sensitivity matches the zoom. Includes the optic's Sensitivity Scale. * **GetSensitivityMultiplier**: Takes your look input and turn rates and returns the new X and Y, and whether to add yaw and pitch. Applies GetMagnificationSensitivityMultiplier while aiming and stops at the free look limits. * **BP\_GetMagnificationSensitivityMultiplier** / **BP\_GetSensitivityMultiplier**: Same as GetMagnificationSensitivityMultiplier and GetSensitivityMultiplier, but you can override them in a Blueprint child of this component. ### Animation Layer[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent#animation-layer) * **LinkAnimLayerClass**: Links an anim layer class to the pawn's meshes and returns it. Use it when Auto Setup Linked Anim Layer is off, or to switch layers, such as a different layer while unarmed. * **LinkAnimLayerClassByInstance**: Same as LinkAnimLayerClass, but links it to the anim instance you pass in. * **UnlinkAnimLayerClass** / **UnlinkAnimLayerClassByInstance**: Unlinks the current anim layer. * **GetShooterFrameworkAnimInstance**: The linked procedural anim layer. ### Components[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent#components) * **GetCurrentFirearmComponent**: The held firearm's [SKGFirearmComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent) . * **GetCurrentProceduralAnimComponent**: The [SKGProceduralAnimComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent) being aimed with, such as the firearm's current optic. * **GetCurrentOpticComponent**: The current [SKGOpticComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent) . * **GetCurrentLightLaserComponents**: The held actor's [SKGLightLaserComponents](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skglightlasercomponent) . Empty if it has none. ### Setup[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent#setup) * **SetupComponents**: Finds the meshes and camera by name. Called for you on BeginPlay. Call it again if you swap them later. * **SetCameraOffset**: Saves the camera's position relative to the head. Called by SetupComponents, and every frame with Constantly Update Camera Offset. * **RefreshLocalPlayerSettings**: Reloads Magnified Optic Mode and Monitor Distance Coefficient from the player. Called for you on BeginPlay, possession and respawn. * **GetProceduralData**: Builds the data the anim layer uses. The anim layer calls it every frame, so you don't need to. ### Getters[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent#getters) * **GetPawnMesh**: The first person mesh for the local player, the third person mesh for other players. * **GetFirstPersonMesh** / **GetThirdPersonMesh**: The meshes found from the names in Initialize. * **GetCameraComponent** / **GetGameplayCameraComponent**: The camera found from Camera Component Name. * **GetCameraAttachedSocket**: Returns Camera Attached Socket. * **GetOwningPawn**: The pawn this component is on. * **GetProceduralShooterPawnData**: Data for your anim graph: the held item's Procedural Anim Gameplay Tag, whether it's right-handed, where free look is looking, and whether anything is held. * **IsLocallyControlled**: True for the local player's pawn. * **GetControlRotation**: The pawn's control rotation, including on other players' machines, where it uses the replicated pitch and yaw. ### Other[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent#other) * **GetShooterPawnComponent**: Returns the SKGShooterPawnComponent on an actor. Events[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent#events) ---------------------------------------------------------------------------------------------------- * **On Held Actor Set**: When the held actor changes, with the new and old actor. Fires for every player. * **On Aim State Changed**: When aiming starts or stops. * **On Free Look State Changed**: When free look starts or stops. * **On Offhand IKIs Left Hand Changed**: When switching between right- and left-handed. * **On Pose Complete**: When a pose finishes, with its tag and whether it was the exit. * **On Firearm Collision Changed**: When firearm collision starts or stops pushing the firearm back. * **On Anim Instance Ticked**: At the end of every anim layer update, with the delta time. [PreviousSKGRangeFinderComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgrangefindercomponent) [NextSKGStockComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgstockcomponent) Last updated 5 days ago Was this helpful? --- # SKGProceduralAnimComponent | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent.md) . Drives the procedural animation: aiming, sway, lag, deadzone, recoil and poses. Add one to everything you want to hold with procedural animation and to every attachment you can aim through such as an optic. This is not specific to firearms, it can be used to give life to holding a rock, box, firearm, sword, flashlight, etc. even your own characters hands for fists! [Setting up a firearm](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-firearm) and [Setting up a red dot](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-red-dot) show it set up on a firearm and an optic. Which settings are used depends on where the component is: * **On a firearm**, or a held item without an [SKGFirearmComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent) , every setting is used. * **On an attachment** such as an optic, only Initialization Settings, Aiming Settings: Aiming Distance, Use Fixed Aiming Distance, Allow Camera Zoom and Can Aim are used. Everything else comes from the firearm. * **On the character**, its settings are used while nothing is held. Set everything on the component and leave the Data Asset fields empty. Using data assets as templates is covered in [Data Assets](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/data-assets) . Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent#settings) ----------------------------------------------------------------------------------------------------------- ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-c1caab1545a2600abfb1ef4c9bf845d0ad11074b%252Fdetails-panel.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=173bdedd8cd65124f1aaafa6ad3fd5c2&sv=3) BP\_BoltGun's SKGProceduralAnim Initialize settings, with a right-handed point aim socket ### Initialize[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent#initialize) * **Auto Initialize**: Sets up the component when it's created. If you turn this off, call `InitializeProceduralAnimComponent` yourself. * **Override Component Names**: Only for setting the mesh name from C++. Leave off. * **Initialization Settings Data Asset**: Leave empty and use Initialization Settings. #### Initialization Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent#initialization-settings) * **Procedural Mesh Name**: Name of the mesh component that has the aim sockets, such as the firearm or optic mesh. * **Procedural Aim Socket Names**: The aim sockets on that mesh. Most need one. An Elcan has two, one through the scope and one for the iron sights on top, and `CycleAimSocket` switches between them. * **Right Hand Dominate Point Aim Socket Name** / **Left Hand Dominate Point Aim Socket Name**: The socket used for point aiming in right- or left-handed mode, such as a canted aim. Leave as None if you don't want point aiming. Usually only set on a firearm. * **Can Use Left Hand Dominate**: Lets the player switch to left-handed mode while holding this. Needs left-handed animations. Only used on the firearm. * **Procedural Anim Gameplay Tag**: Tells the animation what you're holding, so the anim graph can blend to the right idle pose, such as a different tag for an M4 and a SKS. Only used on the held item and is completely optional. * **Gameplay Tags**: Tags you can use to identify this component in your own logic. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-3a28d53d8a16498a12643d59549517b449423bfc%252Faim-socket.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=356e6298cab34a77d9717c6247caf424&sv=3) The S\_Aim socket on the holo sight, placed in the sight window ### Procedural[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent#procedural) Each group below has a Data Asset field above it. Leave it empty and set the values in the group. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-3c3e6e48879e5a806e8220316ab8a3cc7f93729c%252Fprocedural-groups.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=8724f7a858aa2419536737f8442d1ddf&sv=3) The Procedural groups, each with its Data Asset field above it Curves use X forward, Y right, Z up for location, and X roll, Y pitch, Z yaw in degrees for rotation. They're mirrored for you in left-handed mode. Spring settings, used by several groups: * **Stiffness**: How hard it pulls toward the target. * **Critical Damping Factor**: How quickly the bounce settles. 1 settles with no overshoot, lower bounces more. * **Mass**: Heavier feeling, slower response. * **Target Velocity Amount**: How much of the target's movement carries into the spring. #### Aiming Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent#aiming-settings) * **Aiming Distance**: How far in front of the camera you want the aim socket to be when aiming. On an optic, it's added to the firearm's Aiming Distance unless Use Fixed Aiming Distance is enabled. * **Aim Curves**: Optional curves that add motion while aiming in and out. First Person Curve and Third Person Curve each have a Location Curve and Rotation Curve. Only used on the firearm. * **Aim Speed Curve**: Optional curve for finer control of the aim in and out speed. The value is how far aimed in, from 0 to 1, and Default Aiming Speed scales the time. Only used on the firearm. * **Use Fixed Aiming Distance**: On puts this aim socket exactly Aiming Distance from the camera always, so the firearm moves when the optic moves along the rail keeping the optic in place. Off keeps the firearm at the same distance no matter where the optic sits. * **Default Aiming Speed**: How fast you aim in and out. Only used on the firearm. Attachments can change it through procedural stats on the [SKGFirearmComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent) . * **Allow Camera Zoom** / **Camera Zoom Percentage**: Zooms the camera in while aiming through this, by a percentage of the field of view. 10 narrows it by 10%. Magnified optics in Normal mode use their magnification instead. * **Can Aim**: Off skips this aiming device when cycling. #### Procedural Offsets[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent#procedural-offsets) Only used on the held item such as a firearm. * **First Person Base Pose Offset** / **Third Person Base Pose Offset**: Moves the held pose without changing the animation. Fixing the animation is usually the better choice and I personally recommend not using this except for testing. * **Third Person Right Handed Aiming Offset** / **Third Person Left Handed Aiming Offset**: Offset while aiming, as seen in third person. Without it, the sight lines up with the camera in the middle of the head. #### Cycle Aiming Point Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent#cycle-aiming-point-settings) Only used on the held item such as a firearm. Used when switching aim points, such as to another optic, another aim socket, or point aiming. * **Use Spring Interp for Cycling Aiming Point**: Springs to the new aim point with a little overshoot. Off moves there smoothly with no overshoot. * **Spring Interp Settings**: Spring settings for location and rotation. #### Movement Sway Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent#movement-sway-settings) Only used on the held item such as a firearm. Idle breathing and walking sway. The curve plays at quarter speed while standing still and full speed at 250 cm/s in the example project. Its time keeps counting up, so set the curve's extrapolation to Cycle so it loops. * **Use Movement Sway**: Turns movement sway on. * **Location Settings** / **Rotation Settings**: Sway for location and rotation, each with: * **Multiplier**: Scales the curve. `SetSwayMultiplier` on the [SKGShooterPawnComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent) changes it at runtime. * **Multiplier Interpolation Rate**: How quickly a new multiplier blends in. * **Curve**: The sway curve. * **Interp Speed**: How closely it follows the curve. Lower is smoother. #### Movement Lag Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent#movement-lag-settings) Only used on the held item such as a firearm. Tilts the firearm as you move, such as rolling it when strafing. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-f1b63c918b0ee636869e04f24bb6326d021ebb7d%252Fmovement-lag-settings.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=5d62a4085cd9f59be2343f08c7dd1a73&sv=3) Movement Lag Settings, with the Aim rows under the hip ones * **Use Movement Lag**: Turns movement lag on. * **Disable Forward Movement Lag While Aiming**: Stops the forward and backward tilt while aiming. * **Use Spring Interpolation**: On uses Spring Interp Settings, a spring for pitch, roll and yaw. Off uses Interp Settings, a speed for each. * **Aim Spring Interp Settings** / **Aim Interp Settings**: The same settings, used while aiming. They blend in as you aim. * **Remote Interp Settings**: The speed used to show other players' movement lag. * **Forward Backward Normalized Max** / **Left Right Normalized Max** / **Up Down Normalized Max**: Movement speed is divided by these, in cm/s. Lower values tilt more at the same speed. * **Forward Multiplier** / **Backward Multiplier**: Scales the tilt when moving forward or backward. Negative inverts it. * **Multiplier**: Scales the pitch, yaw and roll tilt. * **Axis Routing**: Which rotations each movement direction drives. By default, forward, backward, up and down drive pitch, and left and right drive roll and yaw. #### Rotation Lag Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent#rotation-lag-settings) Only used on the held item such as a firearm. The firearm trails behind (or ahead based on settings) as you turn the camera. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-7b3c1e06c689dc41012b86140d8e629c2aaa2929%252Frotation-lag-settings.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=a0825ce11244cee3685563278c46d723&sv=3) Rotation Lag Settings, with the Aim rows under the hip ones * **Use Rotation Lag**: Turns rotation lag on. * **Use Spring Interpolation**: On uses Spring Interp Settings, a spring for each rotation and location axis. Off uses Interp Settings, a speed for each. Springs only run for the local player. * **Aim Spring Interp Settings** / **Aim Interp Settings**: The same settings, used while aiming. They blend in as you aim. * **Remote Interp Settings**: The rotation and location speeds used to show other players' rotation lag. * **Max Rotation** / **Max Location**: The furthest it can lag, in degrees and cm. * **Rotation Multiplier** / **Location Multiplier**: How much turning moves it. Higher lags more. * **Axis Routing**: Whether each rotation and location axis follows left and right or up and down mouse movement. #### Deadzone Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent#deadzone-settings) Only used on the held item such as a firearm. Lets the firearm drift off center as you move the mouse, up to a limit, like free aim. Local player only. * **Use Deadzone**: Turns deadzone on. * **Pitch Rate** / **Yaw Rate**: How far mouse movement moves the firearm. * **Pitch Limit** / **Yaw Limit**: The furthest it can drift, in degrees. * **Interpolation Speed**: How smoothly it moves. Lower is smoother. * **Disable Deadzone when Aiming** / **Deadzone Aiming Disable Interpolation Speed**: Recenters the firearm while aiming, at that speed. * **Always Interpolate Back to Center** / **Interpolate Back to Center Speed**: Drifts back to center all the time, at that speed. #### Recoil Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent#recoil-settings) Plays each time `PerformProceduralRecoil` is called on the [SKGShooterPawnComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent) . Each curve has random ranges that multiply it every shot, so no two shots look the same. A Roll Random of -12 to 12 rolls the firearm a random direction by a random amount each shot. * **Control Rotation Curve** / **Control Pitch Random** / **Control Yaw Random** / **Control Roll Random**: Kicks the camera. Local player only. * **Location Curve** / **XRandom** / **YRandom** / **ZRandom**: Moves the firearm. * **Location Interp to None Speed**: How fast the firearm moves back after a shot. * **Rotation Curve** / **Pitch Random** / **Yaw Random** / **Roll Random**: Rotates the firearm. * **Rotation Interp to None Speed**: How fast the firearm and camera roll rotate back after a shot. #### Pose Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent#pose-settings) Only used on the held item such as a firearm. Poses such as high ready or low ready, played with `PerformProceduralPose` on the [SKGShooterPawnComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent) . See [Creating a custom pose](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/creating-a-custom-pose) . * **To Curve** / **From Curve**: The curves for entering and leaving the pose, each with a first and third person version. Every curve has a Location Curve, Rotation Curve and Play Rate. * **Curve Tag**: The tag you pass to `PerformProceduralPose`, such as Poses.HighPort. * **Interpolate** / **Interpolation Speed**: Blends toward the curve instead of following it exactly, at that speed. Smooths switching poses partway through. * **Interpolation Speed Multiplier**: Used when you leave or re-enter a pose before it finishes. Higher starts the other curve closer to its beginning. * **Interpolate Constant**: Blends at a fixed rate instead of easing in. * **Interpolation Time**: How long the blending lasts, in seconds. After that the pose follows the curve exactly. Functions[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent#functions) ------------------------------------------------------------------------------------------------------------- ### Initialize[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent#initialize-1) * **InitializeProceduralAnimComponent**: Sets up the component from its settings. Called for you when Auto Initialize is on. * **InitializeProceduralAnimComponentFromSettings**: Sets up the component from the settings you pass in. * **SetProceduralAnimSettings**: Replaces every Procedural group at once. Only changes this machine. ### Aim[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent#aim) * **CanAim** / **SetCanAim**: Gets or sets Can Aim. * **GetProceduralAimingSettings**: Returns the Aiming Settings. * **GetAimWorldTransform**: World transform of the current aim socket. * **GetAimSocketIndex**: Index of the current aim socket in Procedural Aim Socket Names. * **CycleAimSocket**: Switches to the next aim socket, such as from the Elcan's scope to its iron sights. Returns true if it changed. * **StartPointAiming** / **StopPointAiming**: Switches to and from the point aim socket. Use the versions on the [SKGFirearmComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent) . * **UpdateAimOffset** / **UpdateAimOffsetWithSocket**: Recalculates the aim offset. The SKGShooterPawnComponent and SKGFirearmComponent call these for you. ### Muzzle[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent#muzzle) * **GetAimMuzzleTransform**: The aim socket's transform turned to the mesh's forward axis, for your own muzzle zeroing. Can be overridden in a Blueprint child of this component. ### Pose[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent#pose) * **GetPose**: Finds a pose in Pose Settings by its Curve Tag. Returns true if found. ### Data Assets[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent#data-assets) Swaps a group's settings for a data asset at runtime, such as heavier sway while injured. Call these on the server. The change replicates. * **SetAimingSettings** / **SetProceduralOffsets** / **SetCycleAimingPointSettings** / **SetMovementSwaySettings** / **SetMovementLagSettings** / **SetRotationLagSettings** / **SetDeadzoneSettings** / **SetRecoilSettings** / **SetProceduralPoseSettings**: Use the data asset for that group. * **RevertAimingSettings** / **RevertProceduralOffsetsSettings** / **RevertCycleAimingPointSettings** / **RevertMovementSwaySettings** / **RevertMovementLagSettings** / **RevertRotationLagSettings** / **RevertDeadzoneSettings** / **RevertRecoilSettings** / **RevertProceduralPoseSettings**: Go back to the settings the group started with. * **RevertAllSettingsToDefault**: Reverts every group. ### Getters[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent#getters) * **GetAimOffset**: The current aim socket's offset, used by the animation. * **GetProceduralAnimMesh**: The mesh from Procedural Mesh Name. * **CanUseLeftHandDominate**: Returns Can Use Left Hand Dominate. ### Other[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent#other) * **GetProceduralAnimComponent**: Returns the SKGProceduralAnimComponent on an actor. Events[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent#events) ------------------------------------------------------------------------------------------------------- * **On Can Aim Changed**: After SetCanAim changes Can Aim. Local only. * **On Point Aim State Changed**: When point aiming starts or stops. Local only. * **On Aim Socket Cycled**: After CycleAimSocket switches sockets. Local only. * **On Aim Socket Cycled Replicated**: When an aim socket change arrives from another machine. Use it to update what other players see. * **On Procedural Data Assets Changed**: After a data asset is swapped or reverted. The SKGFirearmComponent uses it to pick up the new settings. [PreviousSKGOpticSceneCaptureComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticscenecapturecomponent) [NextSKGRangeFinderComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgrangefindercomponent) Last updated 5 days ago Was this helpful? --- # Physical Materials | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/physical-materials.md) . SKGPhysicalMaterial is optional. Nothing else in the framework needs it, so skip this page if you already have your own impact or footstep system as this is mostly a helper. It's a Physical Material that also holds effects to play when something hits that surface, such as footsteps or bullet impacts. Each effect has a gameplay tag and can play a Niagara effect, place a decal, and play a sound. A wood floor and a metal floor can then play different footstep sounds from the same animation. The example uses it for footsteps on its floor. 1\. Make the physical material[](https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/physical-materials#id-1.-make-the-physical-material) ---------------------------------------------------------------------------------------------------------------------------------------------- In the Content Browser, right-click and pick Physics > Physical Material, then pick SKGPhysicalMaterial as the class. The example's is PM\_Floor in SKGSFExampleContent/Materials/PhysicalMaterials. Add an element to Effects for each kind of hit the surface reacts to: * **Tag**: Which effect this is, such as Impact.Footstep. It has to match the tag you play exactly. Impact.Footstep is the example's tag, in the DT\_Impacts data table in SKGSFExampleContent/Data/DataTables/GameplayTags. * **Impact Visual Settings**: * **Impact Effect**: A Niagara system spawned at the hit. * **Impact Decal**: A decal material placed on the surface, such as a bullet hole. * **Use Particles Rotation**: Off rotates the effect and decal to face out of the surface. On keeps the effect's own rotation, which also stops the decal lining up with the surface, so leave it off when using a decal. * **Decal Size** / **Decal Life Time** / **Decal Fade Screen Size**: How big the decal is, how many seconds it stays, and how small on screen it gets before it fades out. * **Impact Sound Settings**: The **Sound** to play at the hit, with a **Volume Multiplier** and **Pitch Multiplier**. The physical material also has: * **Speed Of Sound Tolerance**: When an effect is played with speed of sound, the sound is delayed by how long it takes to reach the player, such as a distant bullet impact being heard after it's seen. Delays shorter than this play right away. 0.2 seconds by default. * **Gameplay Tags**: Tags you can use to identify this surface in your own logic. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-f4a8e7e15ef64d9ce918cda987930ecd43b89683%252Fpm-floor.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=dfbd471329dcc0e6105f7e015772f383&sv=3) PM\_Floor with an Impact.Footstep effect that plays SC\_FootstepsWood 2\. Use it on a surface[](https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/physical-materials#id-2.-use-it-on-a-surface) -------------------------------------------------------------------------------------------------------------------------------- It can go in three places: * **Phys Material** on a material, like the example's M\_PrototypeGrid with PM\_Floor. Every surface using that material gets it. * **Phys Material** on a material instance, to give one instance a different surface than its parent. * **Phys Material Override** on a mesh or collision component, which wins over the material's. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-de2b36483405faeed0fb8c040456f34e3b7222c9%252Fmaterial-phys-material.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=d9e330d8ad65d9f2d14ff34f9a3af1e5&sv=3) M\_PrototypeGrid with PM\_Floor as its Phys Material 3\. Footsteps[](https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/physical-materials#id-3.-footsteps) ------------------------------------------------------------------------------------------------------------ Add the USKGPlayFootstepSound anim notify to your locomotion animations where each foot lands. It traces 100 cm straight down from the foot and plays the matching effect if the surface has an SKGPhysicalMaterial. * **Foot Bone Name**: The foot the trace starts from, such as foot\_l or foot\_r. * **Physical Material Effect Tag**: The effect to play, such as Impact.Footstep. * **Trace Channel**: The channel the trace uses. Visibility by default. The example's locomotion animations in SKGSFExampleContent/Animation/MannyAnimations/Locomotion already have these notifies with Impact.Footstep. For your own animations, use your own gameplay tag, or migrate DT\_Impacts and add it to Gameplay Tag Table List in Project Settings > Gameplay Tags. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-fe87e80b5c17496e4629b773a9a105a744e02370%252Ffootstep-notify.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=92f16f57f3d9c575cafb088655f953d0&sv=3) MM\_Unarmed\_Walk\_Fwd's USKGPlayFootstepSound notifies, with one on foot\_r using Impact.Footstep 4\. Bullet impacts and other hits[](https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/physical-materials#id-4.-bullet-impacts-and-other-hits) ---------------------------------------------------------------------------------------------------------------------------------------------------- For anything else, call `PlayEffect` on the SKGPhysicalMaterial with the hit result and the effect tag. Get the physical material from the hit's Phys Mat and cast it to SKGPhysicalMaterial. Turn on Use Speed Of Sound for hits the player might be far from, such as bullet impacts. The [projectile system](https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/projectiles) returns the physical material in its hits, so On Impact is a good place to play bullet impacts. Functions[](https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/physical-materials#functions) -------------------------------------------------------------------------------------------------- * **PlayEffect**: Plays the effect with the given tag at the hit. With Use Speed Of Sound on, the sound is delayed by the distance to the local player. * **GetEffect**: Finds the effect with the given tag. Returns true if found. * **GetEffects**: Every effect on this physical material. [PreviousProjectiles](https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/projectiles) Last updated 5 days ago Was this helpful? --- # SKGInfraredHandlerComponent | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skginfraredhandlercomponent.md) . This component is optional. It lets your own lights switch to infrared, so they only show through night vision, such as an IR illuminator. The lights in the timed courses on the example project use it. Lights using the [SKGLightLaserComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skglightlasercomponent) already do this, so they don't need one. Night vision itself is covered in [Setting up night vision](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-night-vision) . The component keeps track of whether the light is in infrared and sends it to every player. It doesn't change the light itself. You do that in your Blueprint when On Infrared Mode Changed fires. Setting up a light[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skginfraredhandlercomponent#setting-up-a-light) -------------------------------------------------------------------------------------------------------------------------------- 1. Add an SKGInfraredHandler component to the actor with the light. 2. On BeginPlay, call `SetupDynamicLightFunctionMaterial` with M\_IRLightFunction from SKGSFCore/Materials/LightFunctions. 3. Bind On Infrared Mode Changed. When it's on, set the light's Light Function Material to `GetLightFunctionMaterial`. When it's off, set it to None. 4. If the light has a glowing mesh, such as a bulb, make it match the light. Give it a material that uses MF\_InfraredMask from SKGSFCore/Materials/Functions, such as M\_EmissiveMaster. In On Infrared Mode Changed, write 1 (infrared) or 0 to the mesh's custom primitive data at the index from `GetIsInfraredCustomPrimitiveIndex`, 5 by default. MF\_InfraredMask then only shows the mesh brightness through night vision while it's infrared. 5. Call `SetInfraredMode` to switch the light in or out of infrared. The example's BP\_LightBase, BP\_PointlightInfrared and BP\_Spotlight in TimedCourse/Lights are set up this way. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-22374a520fecbdec87553fe90de7d11671a9cfec%252Fsetup-light-function.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=8412e9506cdf1cc108789c69b9208c35&sv=3) BP\_LightBase calls SetupDynamicLightFunctionMaterial on BeginPlay, with M\_IRLightFunction in a Light Function Parent Material variable ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-a1403a7bc7c812f2af22bba012bd07682a3a6573%252Finfrared-mode-changed.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=1889eedc0f2451b1c19b500b15975925&sv=3) BP\_PointlightInfrared sets its Light Function Material to GetLightFunctionMaterial in infrared, and None out of it ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-5b7dfa7606795b5d97b93bd5a45a5434d0bf96a0%252Fbulb-material.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=3f9ca55a79ddfdc2ec73d64fef1f2dd7&sv=3) BP\_LightBase writes 1 or 0 to its bulb's (Shape) custom primitive data at GetIsInfraredCustomPrimitiveIndex when infrared mode changes Functions[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skginfraredhandlercomponent#functions) -------------------------------------------------------------------------------------------------------------- ### Infrared[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skginfraredhandlercomponent#infrared) * **SetInfraredMode**: Switches in or out of infrared. Can be called on the client. The change is sent to the server and every player sees it. * **IsInfraredModeOn**: True while in infrared. ### Light Function[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skginfraredhandlercomponent#light-function) * **SetupDynamicLightFunctionMaterial**: Makes a dynamic copy of the light function material you pass in and returns it. The copy is kept up to date with the night vision's mask, so the light only shows inside the night vision view. * **GetLightFunctionMaterial**: The material made by SetupDynamicLightFunctionMaterial. Events[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skginfraredhandlercomponent#events) -------------------------------------------------------------------------------------------------------- * **On Infrared Mode Changed**: When infrared turns on or off, on every player. Swap the light function here. * **On IRLight Mask Changed**: When the night vision's mask changes, such as switching from a monocular to binoculars, with the new mask. The light function material is updated for you. [PreviousSKGFirearmComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent) [NextSKGLightLaserComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skglightlasercomponent) Last updated 5 days ago Was this helpful? --- # SKGFirearmComponent | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent.md) . The attachment components are optional. If you use your own attachment system, call `AddAttachment` and `RemoveAttachment` on this component whenever an attachment is added or removed. The core of every firearm. Add one to each firearm Blueprint. It finds the SKG components on the firearm and its attachments, such as aiming devices, offhand grips, muzzles, lights and lasers, and picks the one in use, such as which optic you aim through or which muzzle the bullet leaves from. The [SKGShooterPawnComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent) reads everything it needs from here. See [Setting up a firearm](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-firearm) for a step by step setup. Set everything on the component in your firearm Blueprint and leave the Data Asset fields empty. Using data assets as templates is covered in [Data Assets](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/data-assets) . Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent#settings) ---------------------------------------------------------------------------------------------------- ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-52b36377d352ff2af2dfcf86fc8399939499bbc7%252Fdetails-panel.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=5f3e1ddb1c738cc405ecb8c412e19e12&sv=3) BP\_BoltGun's SKGFirearm Initialize settings ### Initialize[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent#initialize) * **Auto Initialize**: Sets up the firearm on Begin Play. If you turn this off, call `InitializeFirearmComponent` yourself. * **Firearm Mesh Component Name**: Name of the firearm's mesh component, static or skeletal. The game crashes on Begin Play if no mesh has this name. * **Attachment Manager Component Name**: Name of the [SKGAttachmentManagerComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentmanagercomponent) , if you use one. The firearm then adds and removes attachments for you. Leave as None if you are using your own attachment system. * **Firearm Stats Data Asset**: Leave empty and use Firearm Stat Settings. * **Firearm Stat Settings**: The firearm's base stats: Weight, Durability, Ergonomics, Accuracy (in MOA), Vertical Recoil, Horizontal Recoil and Fire Rate (rounds per minute). Attachments with an [SKGFirearmAttachmentStatComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmattachmentstatcomponent) change them. The framework doesn't use these values itself. Read them with `GetFirearmStats` for your own gameplay and UI. * **Gameplay Tags**: Tags you can use to identify this firearm in your own logic. ### FirearmCollision[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent#firearmcollision) Pulls the firearm back when the barrel runs into a wall. A sphere trace runs down the barrel, and the further it's pushed back, the further the firearm moves along the pose curves. Turn on Draw Debug Trace on the [SKGShooterPawnComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent) to see the trace. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-14b29d48a4493b8a525b753f6bb96f7455b3c00d%252Ffirearm-collision.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=fc5c909d2047e6c9822d2784605d903c&sv=3) BP\_BoltGun's firearm collision settings, using the sample curves * **Firearm Collision Settings Data Asset**: Leave empty and use Firearm Collision Settings. #### Firearm Collision Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent#firearm-collision-settings) * **Use Firearm Collision**: Turns firearm collision on. * **Trace Diameter**: Diameter of the trace, in cm. * **Stop Aiming Distance**: How far the barrel can be pushed back while aiming before aiming stops, relative to the trace length. * **Resume Aiming Distance**: Aiming can start again once the push drops below this. Keep it lower than Stop Aiming Distance, or aiming flickers on and off against a wall. * **Pose Location Curve** / **Pose Rotation Curve**: How the firearm moves as it's pushed back. Location is X forward, Y right, Z up. Rotation is X roll, Y pitch, Z yaw, in degrees. The sample curves pull into a short stock, then point the muzzle down. * **Pose Scale**: How fast the firearm moves through the curves. The curves are read at the push distance in cm times Pose Scale. * **Pose Location Interp Speed** / **Pose Rotation Interp Speed**: How quickly the firearm moves to the new pose. Functions[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent#functions) ------------------------------------------------------------------------------------------------------ ### SKG Firearm[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent#skg-firearm) * **InitializeFirearmComponent**: Sets up the firearm from its settings. Called on Begin Play when Auto Initialize is on. * **InitializeFirearmComponentFromSettings**: Sets up the firearm from the settings you pass in. * **GetFirearmMeshComponent**: The mesh from Firearm Mesh Component Name. ### Attachments[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent#attachments) Call these on the server. * **AddAttachment** / **RemoveAttachment**: Tells the firearm an attachment was added or removed, along with everything attached to it. Only needed with your own attachment system. * **OnStockOffsetChanged**: Passes a stock's rail offset to its [SKGStockComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgstockcomponent) to change the length of pull. Done for you when the stock is in an SKGAttachmentComponent. ### Aim[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent#aim) * **CycleAimingDevice**: Switches to the next aiming device that can aim, such as from a scope to an offset red dot. Is Aiming tells the new optic to start its scope image right away if it is using picture in picture. * **SetAimingDevice**: Switches to a specific aiming device, either the firearm's own or one on an attachment. * **StartPointAiming** / **StopPointAiming**: Aims with the point aim socket set on the firearm's [SKGProceduralAnimComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent) , such as a canted aim. Right Hand Dominant picks the right- or left-handed socket. Is Aiming tells the previous optic to start its scope image again. * **IsPointAiming**: True while point aiming. * **GetAimSocketWorldTransform**: World transform of the current aiming device's aim socket. * **GetMagnifiers**: Every optic on the firearm with Is Magnifier on. ### Muzzle[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent#muzzle) The current muzzle is picked by its muzzle tag: a suppressor first, then a muzzle device, then the barrel. * **ShotPerformed**: Call every time the firearm fires. Passes the shot to every [SKGMuzzleComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgmuzzlecomponent) for muzzle temperature. * **GetMuzzleProjectileTransform**: Where to spawn the bullet and which way to send it. Adds a random spread of up to the specified MOA. While aiming a magnified optic in Normal mode, it also applies that optic's zero. * **GetMuzzleProjectileTransforms**: Same as GetMuzzleProjectileTransform, but for several projectiles at once such as shotgun pellets. Each gets its own spread. * **GetMuzzleTransform**: World transform of the current muzzle. * **IsSuppressed**: True if the current muzzle is a suppressor. ### Zero[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent#zero) * **ZeroOpticsForZeroAtLocation**: Zeroes every magnified optic on the firearm to a location, usually where the bullet is at the zero distance. Get that location from `GetProjectileLocationAtDistance` on the SKGProjectileWorldSubsystem. ### Light Laser[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent#light-laser) Each one calls the matching function on every [SKGLightLaserComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skglightlasercomponent) on the firearm. * **ToggleAllLights** / **ToggleAllLasers** / **ToggleAllLightsStrobe** / **CycleAllLightsIntensity** * **TurnAllLightsOn** / **TurnAllLightsOff** / **TurnAllLasersOn** / **TurnAllLasersOff** * **SetAllLightLaserInfraredMode**: Switches every light and laser to or from infrared. ### Pose[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent#pose) * **GetPose**: Finds a pose by gameplay tag on the firearm's SKGProceduralAnimComponent. Returns true if found. See [Creating a custom pose](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/creating-a-custom-pose) . ### Firearm Stats[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent#firearm-stats) * **GetFirearmStats**: The base stats with every attachment's stats applied. * **SetFirearmStats**: Replaces the current stats and fires On Firearm Stats Changed. Call it on the server so the change replicates. * **AddFirearmAttachmentStats** / **RemoveFirearmAttachmentStats**: Override these in a Blueprint child of this component to change how attachment stats are applied. ### Procedural Stats[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent#procedural-stats) Lets the firearm stats change how it handles, such as a heavier build aiming slower. * **GetProceduralStats** / **SetProceduralStats**: The aim speed, sway, lag and recoil values the animation uses. They start from the firearm's SKGProceduralAnimComponent. * **CalculateProceduralValues**: Resets the procedural stats to the SKGProceduralAnimComponent's values, then fires Calculate Procedural Stats. Runs whenever the firearm stats change. ### Getters[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent#getters) * **GetCurrentProceduralAnimComponent** / **GetCurrentOffhandIKComponent** / **GetCurrentMuzzleComponent** / **GetCurrentOpticComponent** / **GetCurrentStockComponent**: The component in use right now. * **GetProceduralAnimComponents** / **GetOffhandIKComponents** / **GetMuzzleComponents** / **GetLightLaserComponents** / **GetAttachmentStatComponents**: Every component of that type on the attachments. GetLightLaserComponents also includes the firearm's own. * **GetFirearmProceduralAnimComponent** / **GetFirearmOffhandIKComponent** / **GetFirearmMuzzleComponent** / **GetFirearmOpticComponent** / **GetFirearmLightLaserComponent**: The component on the firearm itself, not on an attachment. * **GetAttachmentManagerComponent**: The manager from Attachment Manager Component Name. ### Other[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent#other) * **GetFirearmComponent**: Returns the SKGFirearmComponent on an actor. * **GetParentFirearmComponent** / **GetParentWithFirearmComponent**: Returns the firearm component, or the firearm actor, that an attachment belongs to. Events[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent#events) ------------------------------------------------------------------------------------------------ * **On Aiming Device Cycled**: When the current aiming device changes. Passes the new one. * **On Procedural Anim Components Updated**: When an aiming device is added or removed. * **On Muzzle Component Updated**: When the current muzzle changes, such as when a suppressor is added. * **On Held**: When an SKGShooterPawnComponent starts holding the firearm. * **On Firearm Stats Changed**: When attachments change the firearm stats. Passes the new stats. * **Calculate Procedural Stats**: After CalculateProceduralValues resets the procedural stats. Change the values you want and call `SetProceduralStats`. [PreviousSKGFirearmAttachmentStatComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmattachmentstatcomponent) [NextSKGInfraredHandlerComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skginfraredhandlercomponent) Last updated 5 days ago Was this helpful? --- # SKGLightLaserComponent | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skglightlasercomponent.md) . This component is optional. It runs a flashlight, laser, or both, such as a weapon light, a PEQ or a handheld flashlight. Lights can strobe, and both can switch to infrared so they only show through night vision. Add one to the light or laser attachment, or to the firearm if it's built in. See [Setting up a light and laser](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-light-and-laser) for a step by step setup. Infrared only shows for a player while infrared mode is on, covered in [Setting up night vision](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-night-vision) . The component finds its parts on the same actor by name: * **Light**: Any light component, such as a Spot Light. * **Laser**: A laser beam mesh and a laser dot mesh. Both are needed. The beam is stretched along its Y axis to whatever it hits, and the dot is moved to the hit. The provided SM\_Laser and SM\_LaserDot in SKGSFCore/LightLaser are set up for this. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-ed1794d836ab469af07e7c8c9710c46bfc6f2291%252Fcomponents.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=c63f7b434e5482fb93595b7db93767f4&sv=3) BP\_LightLaser's components, with LaserMesh, LaserDot and SpotLight found by name Set everything on the component and leave the Data Asset fields empty. Using data assets as templates is covered in [Data Assets](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/data-assets) . Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skglightlasercomponent#settings) ------------------------------------------------------------------------------------------------------- ### Initialize[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skglightlasercomponent#initialize) ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-5d5f5078162d9630c99275cdbc915f6a87ab32ed%252Finitialization-settings.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=456d2004c8933bbdf54323516237d5db&sv=3) BP\_LightLaser's Initialization Settings * **Auto Initialize**: Sets up the component on BeginPlay. If you turn this off, call `InitializeLightLaserComponent` yourself. * **Override Component Names**: Only for setting the component names from C++. Leave off. * **Initialization Settings Data Asset**: Leave empty and use Initialization Settings. #### Initialization Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skglightlasercomponent#initialization-settings) * **Light Component Name**: Name of the light component. Leave as None if there's no light. * **Laser Mesh Component Name** / **Laser Dot Component Name**: Names of the laser beam and laser dot meshes. Leave as None if there's no laser. * **Has Infrared Mode**: Lets the light and laser switch to infrared. Infrared modes are skipped when this is off. * **Infrared Light Function Material**: The light function used for the infrared light, so it only shows through night vision. Use M\_IRLightFunction from SKGSFCore. Without it, the light stays dark in infrared. * **Auto Call Force Net Update**: Sends mode changes to other players right away, useful if the actor's net update frequency is low. * **Gameplay Tags**: Tags you can use to identify this component in your own logic. ### Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skglightlasercomponent#settings-1) * **Light Laser Settings Data Asset**: Leave empty and use Light Laser Settings. #### Laser Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skglightlasercomponent#laser-settings) ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-45099f6dd65903d9dac0e19a2e0f3d699d6e2eea%252Flaser-settings.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=8ebcab31e9ed3b10652017e0f301d317&sv=3) BP\_LightLaser's Laser Settings The laser stops at anything that blocks the Laser Collision Channel in [Developer Settings](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings) . The color, brightness, and infrared flag are written to the beam and dot meshes' custom primitive data at the Custom Primitive Index settings which match M\_Laser\_Master and M\_LaserDot\_Master that SM\_Laser and SM\_LaserDot come with. * **Laser Color**: Color of the beam and dot. * **Laser Brightness** / **Laser Dot Brightness**: Brightness of the beam and dot. * **Infrared Laser Brightness** / **Infrared Laser Dot Brightness**: Brightness of the beam and dot in infrared. * **Max Laser Distance**: How far the laser reaches in cm, 200000 (2 km) in the example. Past this, the beam stops and the dot hides. * **Laser Scale Factor**: The length of the laser beam mesh in cm, so it stretches to the right length. 20 for SM\_Laser. #### Light Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skglightlasercomponent#light-settings) ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-c5c86595dfcb2c9a8ec3c50052b63f86ecc853ad%252Flight-settings.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=f8d6f7ae16e620472fd3ecf6d0188bb9&sv=3) BP\_LightLaser's Light Settings, with three brightness levels * **Light Strobe Interval**: Seconds between the light flashing on and off while strobing. * **Light Intensities**: The brightness levels `CycleLightIntensity` steps through, such as 2, 6 and 12 in the example. * **Light Intensities Infrared**: The brightness levels used in infrared. #### Cycle Modes[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skglightlasercomponent#cycle-modes) Each entry's Mode is a mix of the On, IR and Strobe flags. (No Flags Set) is off. * **Laser Cycle Modes**: The modes `CycleLaserMode` steps through. By default (No Flags Set), On, then On | IR. * **Light Cycle Modes**: The modes `CycleLightMode` steps through. By default (No Flags Set), On, On | IR, On | Strobe, then On | IR | Strobe. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-1871796f58b200dbf1749bc93a491e46377a3304%252Fcycle-modes.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=1670306f538f150c0115258eb9cdb5b7&sv=3) The default Laser Cycle Modes and Light Cycle Modes Functions[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skglightlasercomponent#functions) --------------------------------------------------------------------------------------------------------- Everything that changes a mode can be called on the client. The change is sent to the server and every player sees it. ### Initialize[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skglightlasercomponent#initialize-1) * **InitializeLightLaserComponent**: Sets up the component from its settings. Called for you on BeginPlay when Auto Initialize is on. * **InitializeLightLaserComponentFromSettings**: Sets up the component from the settings you pass in. ### Light and Laser[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skglightlasercomponent#light-and-laser) * **CycleLightLaserMode**: Steps both the light and laser to their next cycle mode. * **SetLightLaserMode**: Sets the light and laser modes. * **TurnLightLaserOn** / **TurnLightLaserOff**: Turns both on or off, keeping their infrared and strobe choices. * **SetLightLaserInfrared**: Switches both in or out of infrared. ### Laser[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skglightlasercomponent#laser) * **CycleLaserMode**: Steps the laser to its next mode in Laser Cycle Modes. * **SetLaserCycleModeIndex** / **GetLaserCycleModeIndex**: Sets or gets the laser's place in Laser Cycle Modes. * **SetLaserMode** / **GetLaserMode**: Sets or gets the laser's flags. * **TurnLaserOn** / **TurnLaserOff**: Turns the laser on or off, keeping its infrared choice. * **SetLaserInfraredMode**: Switches the laser in or out of infrared. * **IsLaserOn** / **IsLaserInfrared**: True if the laser is on, or set to infrared. ### Light[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skglightlasercomponent#light) * **CycleLightMode**: Steps the light to its next mode in Light Cycle Modes. * **SetLightCycleModeIndex** / **GetLightCycleModeIndex**: Sets or gets the light's place in Light Cycle Modes. * **SetLightMode** / **GetLightMode**: Sets or gets the light's flags. * **TurnLightOn** / **TurnLightOff**: Turns the light on or off, keeping its infrared and strobe choices. * **SetLightInfraredMode** / **SetLightStrobe**: Switches the light in or out of infrared or strobe. * **CycleLightIntensity**: Steps to the next brightness in Light Intensities, or Light Intensities Infrared while in infrared. * **SetLightIntensityIndex**: Sets the brightness by its place in that list. * **IsLightOn** / **IsLightInfrared**: True if the light is on, or set to infrared. * **IsLightStrobing**: True if the light is on and set to strobe. * **IsLightStrobeEnabled**: True if the light is set to strobe, even while it's off. ### Getters[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skglightlasercomponent#getters) * **GetLightSource** / **GetLaserMesh** / **GetLaserDot**: The components found from the names in Initialization Settings. * **IsInInfraredMode**: True if the light or laser is set to infrared. ### Other[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skglightlasercomponent#other) * **GetLightLaserComponent**: Returns the SKGLightLaserComponent on an actor. Events[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skglightlasercomponent#events) --------------------------------------------------------------------------------------------------- * **On Light Mode Changed** / **On Laser State Changed**: When the light or laser mode changes, with the new flags. * **On Infrared Mode Changed**: When the device goes in or out of infrared. * **On Light Strobed**: Each time the strobing light flashes on or off. * **On Laser Impact**: Every frame the laser is showing, with what it hit and whether it hit anything. [PreviousSKGInfraredHandlerComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skginfraredhandlercomponent) [NextSKGMuzzleComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgmuzzlecomponent) Last updated 5 days ago Was this helpful? --- # SKGMuzzleComponent | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgmuzzlecomponent.md) . This component is optional. It marks where the muzzle is: where bullets leave from and where firearm collision is checked to. Without it, firearm collision won't work and you'll need your own way to find where bullets leave from. It also has an optional muzzle temperature system for a glowing hot suppressor or a hot muzzle in thermal optics. Add one to the firearm and to every attachment that can be the end of the barrel, such as a barrel, muzzle device or suppressor, if you wish to use it. See [Setting up a muzzle device](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-muzzle-device) for a step by step setup. The [SKGFirearmComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent) picks which one is used by its Muzzle Tag: a suppressor first, then a muzzle device, then the barrel. Add a suppressor and the bullets leave from the end of the suppressor. Set everything on the component and leave the Data Asset fields empty. Using data assets as templates is covered in [Data Assets](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/data-assets) . Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgmuzzlecomponent#settings) --------------------------------------------------------------------------------------------------- ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-2772496dce699c46b0fa90b296f21154103c648b%252Fdetails-panel.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=e50e27e86de9aec8579687817fcc317d&sv=3) BP\_MuzzleDevice\_Suppressor's SKGMuzzle settings, tagged as a suppressor with the temperature system on ### Initialize[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgmuzzlecomponent#initialize) * **Auto Initialize**: Sets up the component when it's created. If you turn this off, call `InitializeMuzzleComponent` yourself. * **Override Component Names**: Only for setting the mesh and socket names from C++. Leave off. * **Initialization Settings Data Asset**: Leave empty and use Initialization Settings. #### Initialization Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgmuzzlecomponent#initialization-settings) * **Muzzle Mesh Component Name**: Name of the mesh component that has the muzzle socket, such as the barrel or suppressor mesh. * **Muzzle Socket Name**: The socket at the end of the muzzle. Its X axis (red arrow) must point out of the barrel, the direction the bullet travels. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-5d6932b459307038dd2849ade651a806b281344b%252Fmuzzle-socket.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=9c9b83ceb5a0e9930f368550eff0fcc6&sv=3) The S\_Muzzle socket just past the end of the suppressor, with the red X arrow pointing out of the barrel ### Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgmuzzlecomponent#settings-1) * **Muzzle Settings Data Asset**: Leave empty and use Muzzle Settings. * **Gameplay Tags**: Tags you can use to identify this component in your own logic. #### Muzzle Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgmuzzlecomponent#muzzle-settings) * **Muzzle Tag**: Barrel, Muzzle Device or Suppressor. Decides which muzzle is used when there's more than one. A firearm with a built-in barrel uses Barrel. Muzzle temperature. The temperature is written to the muzzle mesh's custom primitive data every time it changes at Muzzle Temp Custom Primitive Index in [Developer Settings](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings) , 0 for M\_HeatUp\_Master. * **Use Muzzle Temperature System**: Heats the muzzle with each shot and cools it over time. * **Muzzle Temp Curve**: Turns built-up heat (time) into a temperature (value), in Celsius. Each shot moves along the curve and cooling moves back. The first key's value must be 0, since cooling stops when the temperature reaches 0. The last key is the hottest the muzzle can get. The example curve goes from 0 at 25 to 800 at 100, so with Increase Muzzle Temperature Amount at 2 the first 12 shots don't heat it up and it reaches 800 after 50. * **Increase Muzzle Temperature Amount**: How far along the curve each shot moves. * **Decrease Muzzle Temperature Amount Per Tick**: How far back along the curve it moves each second while cooling. * **Use Kelvin for Muzzle Temperature**: Writes the temperature in Kelvin instead of Celsius. * **Auto Handle Muzzle Thermal Stencil Value**: Sets the muzzle mesh's custom depth stencil from 100 when cold to 255 at the hottest, so thermal optics show it heating up. Turn on Render CustomDepth Pass on the mesh. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-0cd60634b52781d341271478a7f1c56f523abf1f%252Ftemperature-curve.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=fff0455a6c96a2b3cea5406daeb0574c&sv=3) C\_MuzzleTemp\_Suppressor, rising from 0 at 25 to 800 at 100 Functions[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgmuzzlecomponent#functions) ----------------------------------------------------------------------------------------------------- ### Initialize[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgmuzzlecomponent#initialize-1) * **InitializeMuzzleComponent**: Sets up the component from its settings. Called for you when Auto Initialize is on. * **InitializeMuzzleComponentFromSettings**: Sets up the component from the settings you pass in. ### Transform[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgmuzzlecomponent#transform) Most of the time use the versions on the [SKGFirearmComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent) , which pick the current muzzle for you. The projectile functions return a location and direction, which is smaller to send to the server than a full transform. * **GetMuzzleTransform**: World transform of the muzzle socket. * **GetMuzzleProjectileTransform**: Where to spawn the bullet and which way to send it. Adds a random spread of up to the specified MOA. * **GetMuzzleProjectileTransformCompensated**: Same as GetMuzzleProjectileTransform, but angled so the shot crosses where the Aim Transform points at Zero Distance Meters. It ignores bullet drop, so it's a rough zero. ### Muzzle Temperature[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgmuzzlecomponent#muzzle-temperature) * **ShotPerformed**: Heats the muzzle by one shot. The SKGFirearmComponent's `ShotPerformed` calls this for you. * **SetMuzzleTemperature**: Sets the temperature directly. * **GetMuzzleTemperatureCelsius** / **GetMuzzleTemperatureFahrenheit** / **GetMuzzleTemperatureKelvin**: The current temperature. * **GetMuzzleTemperatureNormalized**: The current temperature from 0 (cold) to 1 (the curve's hottest). * **IsUsingMuzzleTemperatureSystem**: Returns Use Muzzle Temperature System. ### Getters[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgmuzzlecomponent#getters) * **GetMuzzleTag**: Returns the Muzzle Tag. * **GetMuzzleMesh**: The mesh from Muzzle Mesh Component Name. ### Other[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgmuzzlecomponent#other) * **GetMuzzleComponent**: Returns the SKGMuzzleComponent on an actor. Events[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgmuzzlecomponent#events) ----------------------------------------------------------------------------------------------- * **On Muzzle Temperature Changed**: Each time the temperature changes, with the new temperature. Only on the machine that called ShotPerformed. * **On Muzzle Cooled**: When the muzzle has fully cooled. [PreviousSKGLightLaserComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skglightlasercomponent) [NextSKGNightVisionComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgnightvisioncomponent) Last updated 5 days ago Was this helpful? --- # SKGNightVisionComponent | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgnightvisioncomponent.md) . This component is optional. It runs a night vision device, such as helmet mounted goggles or a clip-on in front of an optic. It sets up the night vision post process materials, the lens, the gain, tube burn-in and an optional infrared illuminator. Add one to the night vision actor, such as the example's BP\_NightVision, or directly to your pawn. See [Setting up night vision](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-night-vision) for a step by step setup. The component doesn't show the night vision on screen by itself. To use it: 1. For the local player only, add the two night vision materials to a Post Process component as blendables with a weight of 0. Get them from `GetNightVisionMaterialPair`, or from `CreateAndSetupDynamicNightVisionMaterialInstance` like the example. 2. When the player turns night vision on, call `TurnTubesOn` on the SKGNightVisionComponent and set the blendables' weight to 1. Call `TurnTubesOff` and set it back to 0 when it's turned off. 3. Also call `EnableInfraredMode` on the SKG Infrared World Subsystem for the local player when night vision turns on, and `DisableInfraredMode` when it turns off. Infrared lights and lasers only show while it's on, and magnified optics only show the night vision image through the tubes while it's on. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-a2325c1a531bf7b268a12eaa03d60665e98d18e7%252Fblendables.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=b943ffa98a5673bf4550e0609aec9109&sv=3) BP\_NightVision adds both night vision materials to its PP Night Vision component with a weight of 0, only for the local player Set everything on the component and leave the Data Asset fields empty. Using data assets as templates is covered in [Data Assets](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/data-assets) . Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgnightvisioncomponent#settings) -------------------------------------------------------------------------------------------------------- ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-992bd9ca4865f25e0d3120d6cdb1092bc0fa68e9%252Ftube-settings.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=e95fa495e45ab8ee5cef0029ccaf179c&sv=3) BP\_NightVision's SKGNightVision component with Tube Settings expanded * **Burn in Render Target** / **IRLight Mask Render Target**: Read only. The textures made while playing for burn-in and the IR light mask. ### Initialize[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgnightvisioncomponent#initialize) * **Auto Initialize**: Sets up the component on BeginPlay. Turn it off to call `InitializeNightVisionComponent` yourself. ### Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgnightvisioncomponent#settings-1) * **Tube Settings Data Asset** / **Housing Settings Data Asset**: Leave empty and use Tube Settings and Housing Settings. #### Tube Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgnightvisioncomponent#tube-settings) The tubes: how the image looks. * **Night Vision Material** / **Night Vision Scintillation Material**: The post process materials for the night vision image and its grain. Use PPM\_NightVision and PPM\_NVScintillation from SKGSFCore/Materials/PostProcess/NightVision. * **Tubes on by Default**: Starts with the tubes on, the same as calling `TurnTubesOn` on BeginPlay. Off in the example. * **Color**: The phosphor color, such as green or white phosphor. * **Gain**: The starting gain, or brightness boost. 250 in the example. * **Contrast**: Contrast of the image. * **Max Gain**: The gain at full, when `SetGain` is 1. * **Signal to Noise Ratio**: Higher gives a cleaner image with less noise. 5 in the example. * **Noise Factor** / **Grain Multiplier**: How much grain the image has. * **Burn in Render Target Size**: Size of the burn-in texture, 1024 in the example. Bright lights streak and can burn into the tubes. 0 turns burn-in off. * **Minimum Luminance for Burn In**: Light brighter than this starts to streak and burn in. * **Burn in Permanent Threshold**: Burn-in this strong never heals. Above 1 means it always heals. * **Burn in Rate Value A** / **B** / **C**: Shape how fast burn-in grows the brighter the light: A × B^x + C. * **Burn in Scale**: Lower burns in slower. * **Burn in Healing Rate**: Higher heals streaks faster. * **IRLight Mask Render Target Size**: Size of the mask that keeps infrared lights inside the night vision lens, 512 in the example. 0 skips it. Mesh Visual Type only. #### Housing Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgnightvisioncomponent#housing-settings) The housing: the lens, gain controls and illuminator. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-7fd6fbb03f01fb0abd64b0abd7ec0ae10ef913f0%252Fhousing-settings.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=ea28a85e6d5331db3a43845f18a79c11&sv=3) BP\_NightVision's Housing Settings * **Visual Type**: How the night vision is seen: * **Mesh**: Through a lens mesh in front of the camera, like the example's dual tube goggles. * **Overlay**: Through a texture mask on the screen, set in Overlay Mask, such as T\_NightVisionDualTubeMask or T\_NightVisionPanoMask. * **Fullscreen**: Over the whole screen. * **Manual Gain**: Lets the player change the gain with `SetGain`, `IncreaseGain` and `DecreaseGain`. * **Smooth Adjust Gain** / **Smooth Adjust Speed**: Changes the gain gradually at this speed instead of all at once. On in the example. * **Gain Adjustment Step Amount**: How much `IncreaseGain` and `DecreaseGain` change the gain, from 0 to 1. 0.1 is 10% of Max Gain. * **Minimum Gain**: The lowest the gain can go, from 0 to 1. * **Lens Mesh Name**: Name of the lens mesh, Tube in the example. Mesh Visual Type only. Its material must support the night vision lens, such as MI\_NVG\_DualTube. * **Eyebox Center Locations**: Sockets on the lens mesh at the center of each tube. 1 for a monocular such as a PVS-14, 2 for dual tubes (S\_EyeboxLeft and S\_EyeboxRight in the example), or 4 for panoramic such as GPNVGs. Any other count is skipped with an error in the log. * **Distortion Radius** / **Distortion Hardness** / **Use Radial Distortion**: Distortion around the edge of each tube. * **Lens Stencil Value**: Custom stencil value written to the lens mesh, used by the IR light mask. Pick a value nothing else in your project uses. 25 by default. The night vision materials read NightVisionStencilValue in MPC\_SKGSF instead, so if you change this, change that to the same value. * **Illuminator Light Component Tag**: Component tag on the light used as the device's infrared illuminator, Illuminator in the example. Leave as None if it has none. * **Infrared Light Function Material**: The light function for the illuminator, so it only shows through night vision. Use M\_IRLightFunction from SKGSFCore. * **Illuminator Brightness Settings**: The brightness levels `CycleIlluminatorBrightness` steps through, such as 0.25, 2 and 5 in the example. The first is the starting brightness. Functions[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgnightvisioncomponent#functions) ---------------------------------------------------------------------------------------------------------- Only the illuminator is sent to other players. The tubes and gain only change on the machine that calls them. ### Initialize[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgnightvisioncomponent#initialize-1) * **InitializeNightVisionComponent**: Sets up the component from its settings. Called for you on BeginPlay with Auto Initialize on. * **InitializeNightVisionComponentFromSettings**: Sets up the component from the settings you pass in. * **SetTubeAndHousingSettings** / **SetTubeAndHousingSettingsFromStructs**: Replaces the settings with the data assets or settings you pass in, such as when switching tubes. Call `CreateAndSetupDynamicNightVisionMaterialInstance` and `SetupIlluminator` afterward to apply them. * **GetTubeSettings** / **GetHousingSettings**: The current settings. ### Materials[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgnightvisioncomponent#materials) * **CreateAndSetupDynamicNightVisionMaterialInstance**: Makes the dynamic night vision and scintillation materials from the settings and returns them. Called during initialize. * **GetNightVisionMaterialPair**: The two dynamic materials. Add both to a post process as blendables. * **SetupIlluminator**: Finds the illuminator light from Illuminator Light Component Tag. Called during initialize. ### Tubes[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgnightvisioncomponent#tubes) * **TurnTubesOn** / **TurnTubesOff**: Turns the tubes on or off and fires On Tubes On State Changed. Turning them on starts burn-in and the IR light mask. It doesn't show or hide the image, you need to do that yourself. * **AreTubesOn**: True while the tubes are on. ### Gain[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgnightvisioncomponent#gain) Needs Manual Gain. * **SetGain**: Sets the gain from 0 to 1 as a fraction of Max Gain. It won't go below Minimum Gain. * **IncreaseGain** / **DecreaseGain**: Changes the gain by Gain Adjustment Step Amount. ### Illuminator[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgnightvisioncomponent#illuminator) Can be called on the client. The change is sent to the server and every player sees it. * **TurnIlluminatorOn** / **TurnIlluminatorOff** / **SetIlluminatorState**: Turns the illuminator on or off. * **IsIlluminatorOn**: True while the illuminator is on. * **CycleIlluminatorBrightness**: Steps to the next level in Illuminator Brightness Settings. * **SetIlluminatorBrightness**: Sets the illuminator's brightness directly. ### Burn In and IR Light Mask[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgnightvisioncomponent#burn-in-and-ir-light-mask) * **IsBurnInAllowed**: True if Burn in Render Target Size is above 0. * **GetBurnInRenderTarget** / **GetIRLightMaskRenderTarget**: The burn-in texture and the IR light mask. Events[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgnightvisioncomponent#events) ---------------------------------------------------------------------------------------------------- * **On Tubes On State Changed**: When the tubes turn on or off. Show or hide the night vision here. [PreviousSKGMuzzleComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgmuzzlecomponent) [NextSKGObjectTemperatureComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgobjecttemperaturecomponent) Last updated 5 days ago Was this helpful? --- # SKGOffhandIKComponent | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgoffhandikcomponent.md) . This component is optional. You can just use a normal animation in its place and bypass its section in the provided anim layer. This component places the offhand on what you're holding and sets the offhand's grip pose. The offhand is the left hand when right-handed and the right hand when left-handed. Add one to the firearm and to every attachment the offhand can hold, such as a handguard or forward grip if you wish to use the system. See [Setting up a handguard and forward grip](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-handguard-and-forward-grip) for a step by step setup. A montage can turn the offhand IK off for a while, such as to grab a magazine during a reload, with the OffhandIKCurveAlpha curve covered in [Performing animations](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/performing-animations) . The [SKGFirearmComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent) picks which one the offhand uses by its Offhand IKTag: a forward grip first, then a handguard, then the firearm. Remove the forward grip and the hand moves to the handguard. When holding something without an SKGFirearmComponent, the one on that item is used. Set everything on the component and leave the Data Asset fields empty. Using data assets as templates is covered in [Data Assets](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/data-assets) . Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgoffhandikcomponent#settings) ------------------------------------------------------------------------------------------------------ ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-14936dfcddc34dad02da1e0a743caaef8c473c8c%252Fdetails-panel.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=32b8b9100a5650b3a9c91b4a7a7a8df8&sv=3) BP\_Foregrip\_AFG's SKGOffhandIK settings, tagged as a forward grip with the AFG grip pose ### Initialize[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgoffhandikcomponent#initialize) * **Auto Initialize**: Sets up the component when it's created. If you turn this off, call `InitializeOffhandIKComponent` yourself. * **Override Component Names**: Only for setting the mesh name from C++. Leave off. * **Initialization Settings Data Asset**: Leave empty and use Initialization Settings. * **Gameplay Tags**: Tags you can use to identify this component in your own logic. #### Initialization Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgoffhandikcomponent#initialization-settings) * **Offhand IKTag**: Firearm, Handguard or Forward Grip. Decides which component the offhand uses when there's more than one. * **Offhand IKMesh Name**: Name of the mesh component that has the hand sockets, such as the handguard or forward grip mesh. * **Left Hand IKSocket Name**: Where the left hand goes when right-handed. * **Right Hand IKSocket Name**: Where the right hand goes when left-handed. Only needed if the firearm has Can Use Left Hand Dominate on its [SKGProceduralAnimComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent) . The socket is where the hand bone goes, not the palm, so place it where the wrist should be when holding the grip. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-00e64b0a2377ce4efb2436a9520871f569c6598f%252Fhand-socket.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=5182e0033a001b1ae179973f4078368f&sv=3) The S\_LeftHandIK socket on the AFG, off to the side where the hand bone sits ### Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgoffhandikcomponent#settings-1) * **Offhand IKSettings Data Asset**: Leave empty and use Offhand IKSettings. #### Offhand IKSettings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgoffhandikcomponent#offhand-iksettings) * **Left Hand IKPose** / **Right Hand IKPose**: The grip pose for the offhand, such as a different hand pose for a vertical grip and an angled grip. Left Hand IKPose is used when right-handed. Functions[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgoffhandikcomponent#functions) -------------------------------------------------------------------------------------------------------- ### Initialize[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgoffhandikcomponent#initialize-1) * **InitializeOffhandIKComponent**: Sets up the component from its settings. Called for you when Auto Initialize is on. * **InitializeOffhandIKComponentFromSettings**: Sets up the component from the settings you pass in. ### Offhand IK[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgoffhandikcomponent#offhand-ik) * **UpdateOffhandIK**: Works out where the hand socket is relative to the component you pass in, and picks the left or right hand pose. The [SKGFirearmComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent) and [SKGShooterPawnComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent) call it for you. ### Getters[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgoffhandikcomponent#getters) * **GetOffhandIKOffset**: The hand socket's offset from the last UpdateOffhandIK, used by the animation. * **GetOffhandIKPose**: The pose picked by the last UpdateOffhandIK. * **GetOffhandIKMesh**: The mesh from Offhand IKMesh Name. ### Other[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgoffhandikcomponent#other) * **GetOffhandIKComponent**: Returns the SKGOffhandIKComponent on an actor. [PreviousSKGObjectTemperatureComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgobjecttemperaturecomponent) [NextSKGOpticComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent) Last updated 6 days ago Was this helpful? --- # SKGObjectTemperatureComponent | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgobjecttemperaturecomponent.md) . This component is optional. It makes meshes show up hot in thermal optics, such as a player's body, and can cool them down over time, such as a body after death. Add one to the actor, and give each mesh that should be hot a component tag, such as Hot. Each tagged mesh gets Render CustomDepth Pass turned on and a custom depth stencil value based on its heat, from 0 (cold) to 1 (hottest). Thermal post process materials, such as an optic's thermal Weighted Blendables, read that stencil. See [Digital and thermal optics](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-magnified-optic#digital-and-thermal-optics) . The stencil range comes from ThermalHotStencilMin and ThermalHotStencilMax in the material parameter collection set in Project Settings > Plugins > SKG Shooter Framework Temperature Settings, MPC\_SKGSF in the example. See [Developer Settings](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings) . Custom Depth-Stencil Pass in Project Settings > Rendering must be set to Enabled with Stencil. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-d4e6336410caaa9a9354d956bbb317de6f4a2d30%252Fdeveloper-settings.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=5638361833561d1559f20837878a7a42&sv=3) The Temperature Material Parameter Collection set to MPC\_SKGSF The example's BP\_PlayerPawn is hot, and BP\_ThermalBodyExample in Misc cools down. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-c7f908f88b3f00304dc21a4665eecbb94367318d%252Fhot-tag.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=56fb4799d9ef6f390fb9c69e62fdf229&sv=3) BP\_ThermalBodyExample's SkeletalMesh with the Hot component tag Set everything on the component and leave the Data Asset field empty. Using data assets as templates is covered in [Data Assets](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/data-assets) . Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgobjecttemperaturecomponent#settings) -------------------------------------------------------------------------------------------------------------- ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-970887bfbb15e012775f39d3e41634610bd5dd2f%252Fsettings.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=31808fce9d1eac715b76fa58e6714e98&sv=3) The SKGObjectTemperature component's settings ### Initialize[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgobjecttemperaturecomponent#initialize) * **Auto Initialize**: Sets up the component on BeginPlay. Turn it off to call `SetupObjectTemperatureComponent` yourself, such as with your own list of meshes. ### Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgobjecttemperaturecomponent#settings-1) * **Temperature Settings Data Asset**: Leave empty and use Temperature Settings. #### Temperature Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgobjecttemperaturecomponent#temperature-settings) * **Hot Component Tag**: The component tag on each mesh that should be hot, Hot in the example. Add it in the mesh's Details panel under Tags > Component Tags. * **Time to Cool**: Seconds to cool from fully hot to cold, 20 by default. * **Starting Heat Value**: The heat it starts with, from 0 (cold) to 1 (hottest). Functions[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgobjecttemperaturecomponent#functions) ---------------------------------------------------------------------------------------------------------------- ### Setup[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgobjecttemperaturecomponent#setup) * **SetupObjectTemperatureComponent**: Sets up the component from the data asset you pass in, or from its own settings if you pass none. Meshes in Component Override are used instead of searching for Hot Component Tag. Called for you on BeginPlay with Auto Initialize on. * **SetupObjectTemperatureComponentFromSettings**: Same as SetupObjectTemperatureComponent, but from the settings you pass in. ### Heat[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgobjecttemperaturecomponent#heat) * **SetHeatValue**: Sets the heat from 0 (cold) to 1 (hottest). Call it on the server. Every player sees it. * **StartCooling**: Starts cooling down to 0 over Time to Cool, such as when a player dies. Call it on the server. Every player sees it. * **StopCooling**: Stops cooling and keeps the current heat. Call it on the server. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-3e036f67d42ea3f3625ef91847ac813b528a7395%252Fstart-cooling.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=4ed8c169cbdf61682503e223306f009d&sv=3) BP\_ThermalBodyExample starts cooling on the server when a projectile hits it [PreviousSKGNightVisionComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgnightvisioncomponent) [NextSKGOffhandIKComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgoffhandikcomponent) Last updated 5 days ago Was this helpful? --- # SKGOpticComponent | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent.md) . Handles everything an optic does: the reticle, brightness, zoom and zeroing. Add it to every optic, from a red dot to a magnified scope. On magnified optics it also drives the [SKGOpticSceneCaptureComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticscenecapturecomponent) . See [Setting up a red dot](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-red-dot) and [Setting up a magnified optic](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-magnified-optic) for step by step setups. Set everything on the component in your optic Blueprint and leave the Data Asset fields empty. Using data assets as templates is covered in [Data Assets](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/data-assets) . ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-35d226e540942da850141abdc1f992d817d5a930%252Fdetails-panel.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=19f017e75827af0715c3737773b6b59c&sv=3) SKGOpticComponent in the Details panel Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent#settings) -------------------------------------------------------------------------------------------------- ### Initialize[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent#initialize) * **Auto Initialize**: Sets up the optic on Begin Play. If you turn this off, call `InitializeOpticComponent` yourself. * **Override Component Names**: Only for setting the component names from C++. Leave off. ### Initialization Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent#initialization-settings) * **Gameplay Tags**: Tags you can use to identify this optic in your own logic. * **Optic Mesh Name**: Name of the optic's mesh component. * **Optic Reticle Mesh Name**: Name of the mesh component that holds the reticle material. Use the same name as Optic Mesh Name if the reticle is on the optic mesh. * **Is Magnifier**: Turn on for magnifiers that sit behind another optic. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-f7d4869cc16ad9b46f869435bf5988c8e96a9905%252Fcomponent-names.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=c117c113ec0e610c5aaf305543701042&sv=3) Mesh component names #### Quality Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent#quality-settings) * **Reticle Distortion Type**: Bends the reticle with the lens. Planar for red dots and holographics, Spherical for magnified optics. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-70e7b98c042cc055aa71e79bc143704fcf538b13%252Freticle-distortion.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=09e613daba3d12912d006daec4776710&sv=3) Planar on a holographic sight (left) and Spherical on an LPVO (right) * **Reticle Distortion Strength**: How strong the reticle distortion is. * **Chromatic Aberration**: Color fringing toward the edge of the lens. 0 turns it off. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-54d3140ff062340428ab85d59099c6df0be8d841%252Fchromatic-aberration.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=8a09c75958a3417e1c58f511cf927a05&sv=3) Color fringing toward the edge of the lens * **Lens Distortion Strength**: Magnified optics only. How much the image bends at the edge of the lens. 0 turns it off. * **Lens Distortion Start Offset**: Where the edge distortion starts. 0 is the center of the lens, 1 is the edge. #### Magnification Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent#magnification-settings) * **Is Magnified**: Turn on for any optic that zooms in. The rest of this group only applies when it's on. * **Use Min Max Magnification**: Off steps through the Magnifications list. On zooms freely between Min and Max Magnification. * **Magnifications**: The zoom levels, lowest first. A 1-8x scope might use 1, 3, 6 and 8. The optic starts on the first entry. * **Min Magnification** / **Max Magnification**: The zoom range when Use Min Max Magnification is on. The optic starts at the minimum. * **Magnification Curve**: Optional. Maps a zoom ring position (0 to 1) to a magnification for `SetZoomPosition`. Without it the mapping is linear. * **Sensitivity Scale**: Aim sensitivity is divided by this while aiming through the optic. 2 halves it. * **Smooth Zoom**: Changes magnification gradually instead of instantly. * **Smooth Zoom Rate**: How fast smooth zoom moves, in magnification per second. * **Smooth Zoom Speed Scaling**: 0 keeps the zoom speed the same at every magnification. 1 slows it down at higher magnification. * **Is First Focal Plane**: On, the reticle grows as you zoom in (first focal plane). Off, it stays the same size (second focal plane). ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-7b92c0e7d45a91dbd9a4b67d17c748903a0d69af%252Fmagnification-settings.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=ff9ba20f3bc7bb0999acecbd8c811b0f&sv=3) Magnification settings #### Scene Capture Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent#scene-capture-settings) Used in Picture in Picture mode by magnified optics with an [SKGOpticSceneCaptureComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticscenecapturecomponent) . * **Optic Scene Capture Component Name**: Name of the SKGOpticSceneCaptureComponent on the optic. * **Is Digital**: Turn on for digital and thermal optics. The image comes from where the capture component is placed instead of following your eye. * **Use Tick Interval**: Off uses Tick Frequency. On uses Tick Interval. * **Tick Frequency**: How many frames to skip between captures. 0 captures every frame, 1 every other frame. * **Tick Interval**: How many times per second to capture. 0 captures every frame. * **Size Render Target to Lens**: Only renders the part of the screen the lens covers. Leave on for best performance. * **Lens Coverage Margin**: Extra space around the lens. Raise it slightly if the image wraps at the edge. * **Min Render Target Size** / **Max Render Target Size**: Limits for the render target size, in pixels. * **Resolution Reduction Amount**: Used when Size Render Target to Lens is off. 1 renders at screen resolution, 2 at half. * **Texture Render Target Format**: Leave at RGBA16f. * **Composite in Post Process**: Draws the scope image in post process after the main view. This removes most of the blur from temporal anti-aliasing. * **Post Process Composite Material**: The material used by Composite in Post Process. Use PPM\_MagnifiedOpticBeforeBloom. * **Custom Depth Stencil Value**: Stencil value used to find the lens on screen. 0 picks one for you. Don't use the night vision stencil value (25 by default). * **Lens Plane Depth Tolerance**: Leave at the default. * **Reticle Plane Socket Name**: Socket where the reticle is drawn. Uses S\_RearLens if the socket doesn't exist. * **Reticle Plane Forward Offset**: Moves the reticle plane forward from that socket, in cm. #### Normal Scope Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent#normal-scope-settings) Used in Normal mode by magnified optics. * **Aperture Radius**: Radius of the lens opening, in cm. Parts of the scope inside this radius are hidden so they don't block your view. Only affects materials that use MF\_NormalScopeCutout. 0 turns this off. * **Aperture Socket Name**: Socket on the optic mesh at the lens opening. Uses S\_RearLens if the socket doesn't exist. * **Aperture Forward Offset**: Moves the opening forward along the scope, in cm. * **Zoom Post Process Material**: Draws the lens effects and the in-lens zoom. Use PPM\_NormalScopeZoom. Leave empty to do all zooming with the camera. * **In Scope Zoom Share**: How much of the zoom happens inside the lens instead of through the camera. 0 zooms only with the camera. * **Reticle Sort Distance Offset**: Draws the reticle in front of the lens glass. Raise it if the glass covers the reticle. #### Light Transmission[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent#light-transmission) * **Light Transmission**: How much light passes through the optic. 1 loses none, 0.5 loses half. * **Night Vision Light Transmission**: Same as above, used while night vision is on. #### Field Stop Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent#field-stop-settings) The field stop is the dark ring around the scope image. Its size sets the optic's field of view, meaning how much you can see through it. Take these values from the scope's spec sheet, which lists field of view in feet at 100 yards. For example, the defaults match the Nightforce ATACR 1-8x, which sees 96.1 ft at 1x. The Vortex Razor HD Gen III 1-10x sees 116 ft at 1x, so its ring is wider and shows more of the scene. * **FOVDistance**: The distance the spec sheet measures field of view at, in yards. Usually 100. * **Low Magnification FOV** / **High Magnification FOV**: Field of view at the lowest and highest magnification, in feet. * **Apply Manual Field Stop Data**: Turn on to enter the half angles below yourself. Off calculates them from the values above. * **Low Magnification Field Stop Half Angle** / **High Magnification Field Stop Half Angle**: The field stop size, in degrees. * **Field Stop Softness Angle**: How soft the edge of the ring is. #### Eye Relief Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent#eye-relief-settings) Controls the eyebox: how close and how centered your eye needs to be to see through the scope. Take these values from the spec sheet. Eyebox Eye Pupil Radius and Eyebox Exit Pupil Tolerance in [Developer Settings](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings) apply to every optic. * **Low Magnification Eye Relief** / **High Magnification Eye Relief**: Eye relief at the lowest and highest magnification, in inches. * **Objective Lens Diameter**: Diameter of the front lens, in mm. For example 24 on an LPVO or 56 on a long range scope. * **Use Default Exit Pupil Diameter**: On calculates the exit pupil from the objective lens diameter. Turn off if the spec sheet lists it. * **Low Magnification Exit Pupil Diameter** / **High Magnification Exit Pupil Diameter**: Exit pupil at the lowest and highest magnification, in mm. ### Reticle Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent#reticle-settings) * **Reticle Material Index**: The material slot (Element) on the reticle mesh that shows the reticle. Use whichever slot your mesh has the reticle on. In the example project, the holographic sight uses slot 1 on its main mesh, and the LPVO keeps its reticle on a separate mesh (StaticMeshReticle) at slot 0. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-f055ab937618db5e978f0fd72f5a3efce3098687%252Freticle-index-holo.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=0c53ffb6f21ffff1e7c2e05bb87306e2&sv=3) Reticle material slot on the holographic sight * **Supports Night Vision**: Allows switching to the night vision brightness levels. * **Reticle Material**: The material applied to that slot. The provided reticle materials are in SKGSFCore/Materials/Optic. * **Normal Reticle Material**: Magnified optics only. The material used in Normal mode. Required for Normal mode. * **Reticle Textures**: The reticles you can switch between with `CycleReticle`. The optic starts on the first one. * **Reticle Texture**: The reticle image. * **Reticle Size**: Size of the reticle. * **Red Channel Color** / **Green Channel Color** / **Blue Channel Color**: Optional. Recolors the parts of the reticle drawn in each channel of the texture. The example uses this to make a red and a green version of the same reticle. At their defaults (red, green, blue) the texture keeps its own colors, so a solid red dot or solid green dot texture works without changing them. * **Un Aimed Capture Delay**: Magnified optics only. Seconds after you stop aiming before the scope image stops updating. * **Reticle Brightness Parameter Name**: Leave as is when using the provided materials. * **Reticle Brightness Settings**: Brightness levels, dimmest first. The optic starts on the first. * **Reticle Night Vision Brightness Settings**: Brightness levels used in night vision mode. * **Weighted Blendables**: Post process materials applied to the scope image, such as thermal color palettes. Switch between them with `CycleNextWeightedBlendable`. Picture in Picture only. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-fc65478ace4cb959e891044d71b30a535f53c5dd%252Freticle-textures.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=a9ce0e48b68e990ebdbde768b6cf704f&sv=3) Reticle textures ### Optic Zero Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent#optic-zero-settings) Magnified optics only. * **Adjustment Type**: MRAD or MOA turret adjustments. * **MRADAdjustment Amount** / **MOAAdjustment Amount**: How far one click moves the point of impact. * **Starting Zero Settings** * **Start with Default Zero**: Starts with the default clicks already dialed in. * **Default Elevation Clicks** / **Default Windage Clicks**: The clicks to start with. * **Start with Random Zero**: Starts with a random number of clicks, up to the max values below in either direction. * **Random Max Elevation Clicks** / **Random Max Windage Clicks**: The most random clicks to start with. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-d8c4aa6511794d72be775cd59dcfef263e9363e9%252Fzero-settings.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=aefcc5d0e15f18aa6e6f66f55d69724a&sv=3) Zero settings Functions[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent#functions) ---------------------------------------------------------------------------------------------------- ### SKG Optic[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent#skg-optic) * **StartedAiming** / **StoppedAiming**: Starts and stops the scope image on magnified optics. The SKGFirearmComponent and SKGShooterPawnComponent call these for you when aiming. Stop Capture Immediately skips the Un Aimed Capture Delay. * **InitializeOpticComponent**: Sets up the optic from its settings. Called on Begin Play when Auto Initialize is on. Call it again if you change settings at runtime. * **InitializeOpticComponentFromSettings**: Sets up the optic from the settings you pass in. * **IsMagnifiedOptic**: Returns true if Is Magnified is on. * **IsMagnifier**: Returns true if Is Magnifier is on. * **GetOpticMesh** / **GetOpticReticleMesh**: Returns the optic and reticle mesh components. * **GetOpticSceneCaptureComponent**: Returns the SKGOpticSceneCaptureComponent, if the optic has one. * **GetPlayerCameraComponent**: Returns the player camera the optic is using. * **SetOpticActive** / **IsOpticActive**: Set by StartedAiming and StoppedAiming. You won't normally need these. * **SetupLocalPlayerCamera**: Finds the local player's camera. This happens automatically. Only call it for custom ownership setups. ### Reticle[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent#reticle) * **CycleReticle**: Switches to the next entry in Reticle Textures. * **IncreaseReticleBrightness** / **DecreaseReticleBrightness**: Moves up or down the Reticle Brightness Settings. Uses the night vision levels while night vision mode is on. * **ToggleReticleNightVisionSetting**: Switches between the normal and night vision brightness levels. Needs Supports Night Vision and at least one night vision brightness level. * **CycleNextWeightedBlendable**: Switches to the next Weighted Blendable, such as the next thermal palette. ### Zoom[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent#zoom) Magnified optics only. * **ZoomIn** / **ZoomOut**: Moves to the next or previous entry in Magnifications. With Use Min Max Magnification, changes the magnification by Zoom Step instead. * **SetZoomPosition**: Sets the zoom from a ring position between 0 and 1, for example from a VR zoom dial. Needs Use Min Max Magnification. * **GetCurrentMagnification**: The magnification the optic is set to. * **GetInterpolatedMagnification**: The magnification right now, including smooth zoom in progress. * **GetCurrentZoomPosition**: The zoom ring position between 0 and 1. Use with On Magnification Changed to rotate a zoom ring mesh. * **GetMinMagnification** / **GetMaxMagnification**: The lowest and highest magnification. * **GetMagnificationSensitivityScale**: Returns Sensitivity Scale. * **GetCurrentMagnificationFOV**: The field of view of the scene capture. Returns 1 if there isn't one. ### Zero[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent#zero) Magnified optics only. * **PointOfImpactUp** / **PointOfImpactDown** / **PointOfImpactLeft** / **PointOfImpactRight**: Moves the point of impact by the given number of clicks. Each click moves it by the Adjustment Amount, so 10 clicks at .1 MRAD is 1 mil. * **PointOfImpactUpDownDefault** / **PointOfImpactLeftRightDefault**: Returns elevation or windage to zero. Returns how many clicks were dialed in before the reset. * **ApplyLookAtRotationZero**: Zeroes the optic to a rotation. Normally called for you by ZeroOpticsForZeroAtLocation on the [SKGFirearmComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent) . * **GetZeroRotation**: The current zero adjustment as a rotation. ### Mode[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent#mode) Magnified optics only. * **SetMagnifiedOpticMode** / **GetMagnifiedOpticMode**: Picture in Picture or Normal. The SKGShooterPawnComponent sets this from the player's setting, so you normally change it through the SKGShooterLocalPlayerSubsystem instead. ### Normal[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent#normal) Magnified optics in Normal mode only. * **IsNormalScopeCutoutEnabled**: True while the aperture cutout is active. * **GetNormalScopeCutoutMeshCount**: How many meshes the cutout is applied to. * **IsNormalScopeZoomActive**: True while the Zoom Post Process Material is active. * **GetNormalScopeZoom**: The zoom applied inside the lens. * **GetNormalCameraMagnification**: The zoom applied through the camera. ### Other[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent#other) * **GetOpticComponent**: Returns the SKGOpticComponent on an actor. Events[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent#events) ---------------------------------------------------------------------------------------------- Bind these to update UI, play sounds or animate parts. They fire on the local client. * **On Magnification Changed**: Every time the magnification changes, including each step of smooth zoom. * **On Zoom Changed**: When ZoomIn, ZoomOut or SetZoomPosition changes the zoom. Zoomed In is true when zooming in. * **On Reticle Cycled**: After CycleReticle. * **On Reticle Brightness Changed**: After IncreaseReticleBrightness or DecreaseReticleBrightness. Was Successful is false when already at the top or bottom level. * **On Night Vision Mode Changed**: After ToggleReticleNightVisionSetting. * **On Point of Impact Changed**: After any zero change, with the total elevation and windage clicks. * **On Point of Impact Up/Down/Left/Right Changed**: After a click in that direction. * **On Point of Impact Up Down Reset** / **On Point of Impact Left Right Reset**: After returning to zero. * **On Scene Capture State Changed**: When the scope image starts or stops. * **On Magnified Optic Mode Changed**: When switching between Picture in Picture and Normal. [PreviousSKGOffhandIKComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgoffhandikcomponent) [NextSKGOpticSceneCaptureComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticscenecapturecomponent) Last updated 6 days ago Was this helpful? --- # SKGOpticSceneCaptureComponent | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticscenecapturecomponent.md) . Renders the zoomed image for magnified optics in Picture in Picture mode. The [SKGOpticComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent) controls it, so it's set up through the optic's [Scene Capture Settings](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent#scene-capture-settings) and you rarely need to call it directly. Only needed if your game uses Picture in Picture mode. See [Setting up a magnified optic](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-magnified-optic) for a step by step setup. Setup[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticscenecapturecomponent#setup) -------------------------------------------------------------------------------------------------------- * Add it to your optic Blueprint and attach it to the optic mesh, facing forward along the scope. * Its name must match **Optic Scene Capture Component Name** on the SKGOpticComponent. The default is SKGOpticSceneCapture. * The optic mesh needs an S\_ObjectiveLens socket and the reticle mesh needs an S\_RearLens socket. While capturing, the component moves to the objective lens and shifts with your eye position. The image changes as you move your head, like looking through lens instead of a camera. * For digital and thermal optics, turn on **Is Digital** on the SKGOpticComponent. This turns that effect off, so the component stays where you placed it and acts like a camera showing its image on a screen. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-e7a428762087ae0d9f864da4a6591c35df31abe4%252Fscene-capture-setup.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=a74aa9875dcbfb2f2f293f904c187a3e&sv=3) SKGOpticSceneCapture attached to the optic mesh, facing forward Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticscenecapturecomponent#settings) -------------------------------------------------------------------------------------------------------------- * **Gameplay Tags**: Tags you can use to identify this capture in your own logic. Functions[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticscenecapturecomponent#functions) ---------------------------------------------------------------------------------------------------------------- Zoom and zero are controlled through the [SKGOpticComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent) . ### Tick[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticscenecapturecomponent#tick) * **StartCapture** / **StopCapture**: Starts and stops rendering the scope image. Called by StartedAiming and StoppedAiming on the SKGOpticComponent. Does nothing in Normal mode. * **IsCapturing**: True while the scope image is rendering. ### Shared View[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticscenecapturecomponent#shared-view) Only used when **Use Shared View Family for Magnified Optics** is on in the SKGOptic developer settings. The scope image is then rendered alongside the main view instead of by a separate scene capture. See [Shared view family](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-magnified-optic#shared-view-family) . * **WarmUpSharedView**: Renders the scope for a few frames without showing it, so the first aim doesn't hitch. Call it at a quiet moment, such as after equipping the weapon. Returns true if the warm up started. * **IsWarmingUpSharedView**: True while the warm up is running. * **IsUsingSharedViewFamily**: True if the scope image is rendered through the shared view family. ### Other[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticscenecapturecomponent#other) * **GetOpticSceneCaptureComponent**: Returns the SKGOpticSceneCaptureComponent on an actor. [PreviousSKGOpticComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent) [NextSKGProceduralAnimComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent) Last updated 6 days ago Was this helpful? --- # SKGStockComponent | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgstockcomponent.md) . This component is optional. It sets the length of pull, which moves the firearm forward or back from the shoulder, such as when an M4 stock is extended or collapsed or an underfolding AK stock is folded. Without it, the length of pull is 0. Add the SKGStock component to the stock's attachment actor. A stock has to be an attachment, the component is ignored when it's placed on the firearm itself as it is designed to be used with the attachment system. The [SKGFirearmComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent) finds it for you and the provided anim layer applies the length of pull. Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgstockcomponent#settings) -------------------------------------------------------------------------------------------------- ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-3f0d69bcc827bbd5df6749c6fcefb06984913768%252Fdetails-panel.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=be82ef4c61a9955a66606f8d3b330bd7&sv=3) BP\_M4\_Stock's SKGStock settings, following its rail offset ### Initialize[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgstockcomponent#initialize) * **Can be Folded**: Lets the stock fold, such as an underfolding AK or an MCX. * **Can be Affected by Offset**: Lets the stock's rail offset change the length of pull, such as sliding an M4 stock along the buffer tube. The SKGFirearmComponent handles this for you when the stock is attached with an [SKGAttachmentComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentcomponent) . The offset is ignored while folded. * **Unfolded Length Of Pull**: The length of pull in cm when unfolded. Higher moves the firearm further forward from the shoulder. * **Folded Length Of Pull**: The length of pull in cm when folded. For an underfolding AK, Unfolded Length Of Pull might be 0 and Folded Length Of Pull -3. Functions[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgstockcomponent#functions) ---------------------------------------------------------------------------------------------------- ### Fold[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgstockcomponent#fold) * **Fold** / **Unfold** / **ToggleFold**: Folds or unfolds the stock if Can be Folded is on. Can be called on the client, the change is sent to the server. * **IsFolded**: True if the stock is folded. * **CanBeFolded**: Returns Can be Folded. * **CanBeAffectedByOffset**: Returns Can be Affected by Offset. ### Length of Pull[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgstockcomponent#length-of-pull) * **SetOffset**: Changes the length of pull by an offset, such as how far the stock is slid along the buffer tube. The offset is subtracted from Unfolded Length Of Pull. Call on the server. The SKGFirearmComponent calls it for you when the stock is attached with an SKGAttachmentComponent. * **GetLengthOfPull**: The current length of pull, including the offset. * **GetUnfoldedLengthOfPull** / **GetFoldedLengthOfPull**: Returns Unfolded Length Of Pull or Folded Length Of Pull. ### Other[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgstockcomponent#other) * **GetStockComponent**: Returns the SKGStockComponent on an actor. Events[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgstockcomponent#events) ---------------------------------------------------------------------------------------------- * **On Folded**: When the stock folds or unfolds, with whether it's folded. * **On Length Of Pull Changed**: When the length of pull changes, with the new length of pull. [PreviousSKGShooterPawnComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent) [NextProjectiles](https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/projectiles) Last updated 5 days ago Was this helpful? --- # SKGRangeFinderComponent | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgrangefindercomponent.md) . This component is optional. It measures the distance to whatever it's pointed at and can show it on a Text Render component, such as a handheld or weapon mounted range finder. Add one to the range finder actor. The component finds its parts on the same actor by name: * **Mesh**: The range finder's mesh, with a socket the range is measured from. The range is measured along the socket's X axis, so point it where the range finder aims. * **Text Render**: Optional. Shows the range, such as on the range finder's screen. The range stops at anything that blocks the Range Finder Collision Channel in [Developer Settings](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings) . It ignores the range finder, everything it's attached to up to the pawn holding it, and everything else attached to them such as the other attachments on the firearm. Ranging isn't replicated, so each player's machine measures for itself locally. Set everything on the component and leave the Data Asset field empty. Using data assets as templates is covered in [Data Assets](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/data-assets) . Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgrangefindercomponent#settings) -------------------------------------------------------------------------------------------------------- ### Initialize[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgrangefindercomponent#initialize) ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-0c2f0966006aaf7b54812d83bbaead3737e43d97%252Finitialize.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=dfb556410835b7548cdee146d07cc31d&sv=3) The SKGRangeFinder component's Initialize settings * **Auto Initialize**: Sets up the component on BeginPlay. Turn it off to call `InitializeRangeFinderComponent` yourself. * **Range Finder Mesh Name**: Name of the range finder's mesh. StaticMesh by default. * **Range Finder Laser Socket Name**: The socket on that mesh the range is measured from. S\_Laser by default. * **Text Render Component Name**: Name of the Text Render component that shows the range. Leave as None if you don't want one. * **Gameplay Tags**: Tags you can use to identify this component in your own logic. ### Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgrangefindercomponent#settings-1) ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-b0b9058c5e9727e5b08c447b2b8f8a7c3efb79ee%252Fsettings.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=0fbb16bc4067ea4d0fa555f5e18d6db0&sv=3) The SKGRangeFinder component's Range Finder Settings * **Range Finder Settings Data Asset**: Leave empty and use Range Finder Settings. #### Range Finder Settings[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgrangefindercomponent#range-finder-settings) * **Gameplay Tags**: Added to the component's Gameplay Tags. * **Min Trace Distance**: Anything closer than this reads 0. In cm like Max Trace Distance. * **Max Trace Distance**: How far the range finder reaches in cm, 100000 (1 km) by default. Past this, it reads 0. * **Measurement Symbols**: The text shown after the number for each unit: **Meter Symbol**, **Yard Symbol**, **Inch Symbol** and **Centimeter Symbol**. m, yd, in and cm by default, so 150 meters shows as 150m. * **Use in Yard Meter** / **Use Metric**: Pick the unit together: * Both on: meters. * Only Use Metric on: centimeters. * Only Use in Yard Meter on: yards. * Both off: inches. * **Auto Range**: Measures on its own every Auto Range Interval and updates the Text Render. Off only measures when you call `GetRange`. * **Auto Range Interval**: Seconds between measurements. Functions[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgrangefindercomponent#functions) ---------------------------------------------------------------------------------------------------------- ### Initialize[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgrangefindercomponent#initialize-1) * **InitializeRangeFinderComponent**: Sets up the component from its settings. Called for you on BeginPlay with Auto Initialize on. * **InitializeRangeFinderComponentFromSettings**: Sets up the component from the settings you pass in. ### Range[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgrangefindercomponent#range) * **GetRange**: Measures now and returns the distance in the chosen unit, or 0 if nothing is in range. Also updates the Text Render and fires On Ranged. * **GetRangeAsString**: Same as GetRange, but returns the text with its symbol, such as 152m. The text only shows whole numbers. ### Getters[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgrangefindercomponent#getters) * **GetRangeFinderMesh** / **GetTextRenderComponent**: The components found from the names in Initialize. ### Other[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgrangefindercomponent#other) * **GetRangeFinderComponent**: Returns the SKGRangeFinderComponent on an actor. Events[](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgrangefindercomponent#events) ---------------------------------------------------------------------------------------------------- * **On Ranged**: Each measurement, with the distance in the chosen unit, or 0 when nothing is in range. [PreviousSKGProceduralAnimComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent) [NextSKGShooterPawnComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent) Last updated 5 days ago Was this helpful? --- # Projectiles | SneakyKittyGameDev Docs For the complete documentation index, see [llms.txt](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt) . This page is also available as [Markdown](https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/projectiles.md) . The projectile system is optional. It fires simple bullets that drop with gravity, slow down with drag and drift with wind, without spawning an actor for each one. Each bullet stops at the first thing it hits, with no penetration or ricochet. It's good for getting started and testing. For realistic bullets, I recommend the [Terminal Ballistics](https://www.fab.com/listings/c13b65e3-5a9e-4f6e-b607-5313eaff541d) plugin. Bullets are run by the SKGProjectileWorldSubsystem and set up with a Projectile Definition data asset. Make one from right-click > SKG > Data Assets > Projectile > Projectile Definition in the Content Browser. The example's DA\_556 in SKGSFExampleContent/Data/Projectiles is a 5.56 round. Bullets aren't replicated, they are designed to be simulated locally. They move in fixed steps of 1/120 of a second whatever the frame rate, so a bullet follows the same path on every machine. Firing a bullet[](https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/projectiles#firing-a-bullet) ------------------------------------------------------------------------------------------------------- Call `FireProjectile` on the SKGProjectileWorldSubsystem with the Projectile Definition and the [SKGFirearmComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent) 's `GetMuzzleProjectileTransform` as the Launch Transform. Put the shooter and the firearm's attachments in Actors To Ignore so the bullet doesn't hit them. Bind On Impact to handle what the bullet hits, such as damage and impact effects. The example's BP\_Firearm does this in its FireShot function, with DA\_556 in its Projectile variable. ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-09508084b56695b882f5119caecc8c979e2df4e8%252Ffire-projectile.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=35cbf3179a04b28d912980c733951957&sv=3) BP\_Firearm ignores its owner and attachments, fires DA\_556 from GetMuzzleProjectileTransform, and binds On Impact to OnProjectileImpact Projectile Definition[](https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/projectiles#projectile-definition) ------------------------------------------------------------------------------------------------------------------- ![](https://sneakykittygamedev.gitbook.io/skgsfdocs/~gitbook/image?url=https%3A%2F%2F269935405-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FGVoX298kWuMi1eriEGGl%252Fuploads%252Fgit-blob-cb77144b33bd360c3506a364cf8dfda78da037d4%252Fprojectile-definition.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=f4ff2e440497d33fbd62584fcfcbc243&sv=3) DA\_556, which uses the default values * **Velocity**: Speed when fired in cm/s. 75000 (750 m/s) by default. * **Weight**: Weight in grains. Currently has no effect. * **Drag Coefficient**: How quickly the bullet slows down. Higher slows it faster. 0.283 by default. * **Lifetime**: Seconds before a bullet that hasn't hit anything is removed. 6 by default. * **Collision Channel**: The channel the bullet traces on. It hits anything that blocks it. * **Particle Data**: An optional Niagara system that follows the bullet: * **Particle**: The Niagara system, such as a tracer. * **Particle Spawn Delay Distance**: How far in cm the bullet travels before it appears, such as 10000 for a tracer that starts at 100 m. * **Debug Data**: Editor only: * **Debug Path**: Draws the bullet's path in red and its impact as a green sphere. * **Line Thickness**: Thickness of the path line. * **Debug Impact**: Draws a sphere where the bullet hits. * **Impact Radius**: Size of the impact sphere. * **Debug Lifetime**: Seconds the drawings stay. Functions[](https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/projectiles#functions) ------------------------------------------------------------------------------------------- All on the SKGProjectileWorldSubsystem. ### Firing[](https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/projectiles#firing) * **FireProjectile**: Fires one bullet. * **Projectile ID**: Your own number to tell bullets apart in the events. * **Owner**: Passed back in the events, such as the shooter. * **Actors To Ignore**: Actors the bullet passes through, such as the shooter and the firearm. * **Launch Transform**: Where the bullet starts, pointing along its X axis. * **Visual Component Override**: A component to move along with the bullet instead of spawning the Particle. * **On Impact**: When the bullet hits something, with the hit, the bullet's velocity, its ID and Owner. The hit includes the surface's physical material, so this is where to play impact effects, such as with an [SKGPhysicalMaterial](https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/physical-materials) . * **On Position Update**: Every step of the bullet's flight, with its location, velocity, ID and Owner. * **FireProjectiles**: Fires one bullet per Launch Transform, such as shotgun pellets from `GetMuzzleProjectileTransforms`. Projectile IDs match the transforms in order. * **GetProjectileByID**: Finds a bullet still in flight by its ID. ### Wind[](https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/projectiles#wind) * **SetWindSources**: The Wind Directional Source actors that push bullets. Each bullet uses the closest one. With none set, there's no wind. ### Zeroing[](https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/projectiles#zeroing) To zero a firearm's optics, pass the location from `GetProjectileLocationAtDistance` to the [SKGFirearmComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent) 's `ZeroOpticsForZeroAtLocation` in a single frame. * **GetProjectileLocationAtDistance**: Where the bullet is after traveling a distance in meters, with drop and drag but no wind. It's measured for a level shot along the world X axis from the Launch Transform's location, so use it for zeroing, not as a spot in the world. * **GetProjectileZero**: The rotation that zeroes a sight to a distance in meters, from the Launch Transform and the sight's aim transform. * **GetProjectileZeroAtLocation**: Same as GetProjectileZero, but to a location from `GetProjectileLocationAtDistance`. `ZeroOpticsForZeroAtLocation` uses it. [PreviousSKGStockComponent](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgstockcomponent) [NextPhysical Materials](https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/physical-materials) Last updated 5 days ago Was this helpful? * [Firing a bullet](https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/projectiles#firing-a-bullet) * [Projectile Definition](https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/projectiles#projectile-definition) * [Functions](https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/projectiles#functions) * [Firing](https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/projectiles#firing) * [Wind](https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/projectiles#wind) * [Zeroing](https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/projectiles#zeroing) Was this helpful? --- # Unknown \# SneakyKittyGameDev Docs ## SKG Shooter Framework - \[SKG Shooter Framework\](https://sneakykittygamedev.gitbook.io/skgsfdocs/readme.md) - \[Project Setup\](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/project-setup.md) - \[Using the framework\](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/using-the-framework.md) - \[Developer Settings\](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings.md) - \[Data Assets\](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/data-assets.md) - \[Multiplayer\](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/multiplayer.md) - \[Troubleshooting\](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/troubleshooting.md) - \[Updating to 2.0.0\](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/updating-to-2-0-0.md) - \[Setting up a pawn\](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-pawn.md) - \[Setting up the animation blueprint\](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-the-animation-blueprint.md) - \[Setting up a firearm\](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-firearm.md) - \[Setting up attachments\](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-attachments.md) - \[Gameplay tag attachment compatibility\](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/gameplay-tag-attachment-compatibility.md) - \[Setting up a red dot\](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-red-dot.md) - \[Setting up a magnified optic\](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-magnified-optic.md) - \[Setting up a handguard and forward grip\](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-handguard-and-forward-grip.md) - \[Setting up a muzzle device\](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-muzzle-device.md) - \[Setting up a light and laser\](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-light-and-laser.md) - \[Setting up night vision\](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-night-vision.md) - \[Holding other items\](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/holding-other-items.md) - \[Creating a custom pose\](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/creating-a-custom-pose.md) - \[Performing animations\](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/performing-animations.md) - \[SKGAttachmentComponent\](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentcomponent.md) - \[SKGAttachmentManagerComponent\](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentmanagercomponent.md) - \[SKGCharacterMovementComponent\](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgcharactermovementcomponent.md) - \[SKGFirearmAttachmentStatComponent\](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmattachmentstatcomponent.md) - \[SKGFirearmComponent\](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent.md) - \[SKGInfraredHandlerComponent\](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skginfraredhandlercomponent.md) - \[SKGLightLaserComponent\](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skglightlasercomponent.md) - \[SKGMuzzleComponent\](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgmuzzlecomponent.md) - \[SKGNightVisionComponent\](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgnightvisioncomponent.md) - \[SKGObjectTemperatureComponent\](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgobjecttemperaturecomponent.md) - \[SKGOffhandIKComponent\](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgoffhandikcomponent.md) - \[SKGOpticComponent\](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent.md) - \[SKGOpticSceneCaptureComponent\](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticscenecapturecomponent.md) - \[SKGProceduralAnimComponent\](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent.md) - \[SKGRangeFinderComponent\](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgrangefindercomponent.md) - \[SKGShooterPawnComponent\](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent.md) - \[SKGStockComponent\](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgstockcomponent.md) - \[Projectiles\](https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/projectiles.md) - \[Physical Materials\](https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/physical-materials.md) --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation This site has an agentic ask interface you may use to query the documentation dynamically by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/index.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/project-setup.md). # Project Setup The framework comes in two parts: the plugin, which holds all of the code, and the content in the example project. The example project's Content folder has two folders: \* \*\*SKGSFCore\*\*: Required. The materials, meshes, anim layers, post process materials and other assets the system uses, such as MPC\\\_SKGSF, the optic and night vision materials, AnimLayer\\\_SKGSF\\\_Procedurals and the laser meshes. The framework doesn't work without it. \* \*\*SKGSFExampleContent\*\*: Optional. The example project's own assets and logic shown in the demo, such as BP\\\_PlayerPawn, BP\\\_M4, the mannequin and its animations, and the timed course. It's a premade project to show everything working and to get you started. I don't recommend building your game on top of the example project. Keep it as a reference instead. ## Adding the framework to your project 1. Install the plugin to your project's Plugins folder, next to your .uproject file, so it ends up in YourProject/Plugins/SKGShooterFramework. If the Plugins folder doesn't exist, create it. 2. Open the example project, right-click the SKGSFCore folder in the Content Browser and pick Migrate (make sure only items in the SKGSFCore folder are checked). Pick your project's Content folder as the destination. Migrate keeps the folder structure, so everything inside it keeps working. 3. Open your project and set up the \[Developer Settings\](/skgsfdocs/getting-started/developer-settings.md). Project settings aren't copied when you migrate content, so the mesh forward axis, collision channels and MPC\\\_SKGSF need setting in your project. 4. Set Custom Depth-Stencil Pass to Enabled with Stencil in Project Settings > Engine > Rendering, under Postprocessing. Optics, night vision and thermal use custom stencil values. Then follow \[Setting up a pawn\](/skgsfdocs/setup-guides/setting-up-a-pawn.md). --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/project-setup.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/using-the-framework.md). # Using the framework Use the \[SKGShooterPawnComponent\](/skgsfdocs/components/skgshooterpawncomponent.md) as your way into the rest of the framework. It keeps track of what the player is holding and some of its components. For example, if you are holding a firearm, the \[SKGShooterPawnComponent\](/skgsfdocs/components/skgshooterpawncomponent.md) holds the \[SKGFirearmComponent\](/skgsfdocs/components/skgfirearmcomponent.md) from the held actor so you can access it. ## The pawn component Aiming, leaning, free look, poses and recoil are called here. These getters return what's in use right now: \* \*\*GetHeldActor\*\*: What the player is holding. \* \*\*GetCurrentFirearmComponent\*\*: The held firearm's \[SKGFirearmComponent\](/skgsfdocs/components/skgfirearmcomponent.md). None when the held actor isn't a firearm. \* \*\*GetCurrentProceduralAnimComponent\*\*: The \[SKGProceduralAnimComponent\](/skgsfdocs/components/skgproceduralanimcomponent.md) being aimed with. \* \*\*GetCurrentOpticComponent\*\*: The \[SKGOpticComponent\](/skgsfdocs/components/skgopticcomponent.md) being aimed through. \* \*\*GetCurrentLightLaserComponents\*\*: Every \[SKGLightLaserComponent\](/skgsfdocs/components/skglightlasercomponent.md) on what the player is holding. These work for anything held, such as a flashlight. With a firearm they come from its \[SKGFirearmComponent\](/skgsfdocs/components/skgfirearmcomponent.md). They return None when nothing is in use, such as with no optic attached, so check them with Is Valid. ## The firearm component For more control over a firearm and its accessories, get its \[SKGFirearmComponent\](/skgsfdocs/components/skgfirearmcomponent.md) with \`GetCurrentFirearmComponent\`. It holds every SKG component on the firearm and its attachments, such as, but not limited to: \* \*\*Lights and lasers\*\*: \`ToggleAllLights\` and \`ToggleAllLasers\` switch every device at once. Use \`GetLightLaserComponents\` to pick a specific one. \* \*\*Optics\*\*: \`GetCurrentOpticComponent\` to zoom with \`ZoomIn\` or change the reticle with \`IncreaseReticleBrightness\`. \`CycleAimingDevice\` switches to the next optic. \* \*\*Muzzle\*\*: \`GetCurrentMuzzleComponent\`, and \`GetMuzzleProjectileTransform\` for where to spawn the bullet. \* \*\*Offhand\*\*: \`GetCurrentOffhandIKComponent\`, such as the forward grip being held. \* \*\*Stock\*\*: \`GetCurrentStockComponent\`. See \[SKGFirearmComponent\](/skgsfdocs/components/skgfirearmcomponent.md#functions) for the full list. --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/using-the-framework.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/readme.md). # SKG Shooter Framework The SKG Shooter Framework is a set of components for building first and third person shooters in Unreal Engine. Add the components to your pawn, firearms and attachments, and they handle aiming, sway, recoil, poses, attachments, optics, lights and lasers, night vision, thermal and more. Everything is replicated for multiplayer. It isn't limited to firearms. Anything you hold can use the procedural animation, such as a flashlight, a rock, or your character's own fists. These docs are for version 2.0.0. ## Getting started Start with \[Project Setup\](/skgsfdocs/getting-started/project-setup.md) to add the framework to your project. The example project has everything in these docs set up so feel free to use it as a reference. Follow these in order: 1. \[Project Setup\](/skgsfdocs/getting-started/project-setup.md) 2. \[Developer Settings\](/skgsfdocs/getting-started/developer-settings.md): your mesh forward axis, collision channels and material parameter collection. 3. \[Setting up a pawn\](/skgsfdocs/setup-guides/setting-up-a-pawn.md) 4. \[Setting up the animation blueprint\](/skgsfdocs/setup-guides/setting-up-the-animation-blueprint.md) 5. \[Setting up a firearm\](/skgsfdocs/setup-guides/setting-up-a-firearm.md) 6. \[Setting up attachments\](/skgsfdocs/setup-guides/setting-up-attachments.md), if you use the attachment system. Then use the guides for what your game needs: \* Optics: \[Setting up a red dot\](/skgsfdocs/setup-guides/setting-up-a-red-dot.md) and \[Setting up a magnified optic\](/skgsfdocs/setup-guides/setting-up-a-magnified-optic.md) \* Attachments: \[Setting up a handguard and forward grip\](/skgsfdocs/setup-guides/setting-up-a-handguard-and-forward-grip.md), \[Setting up a muzzle device\](/skgsfdocs/setup-guides/setting-up-a-muzzle-device.md), \[Setting up a light and laser\](/skgsfdocs/setup-guides/setting-up-a-light-and-laser.md) and \[Gameplay tag attachment compatibility\](/skgsfdocs/setup-guides/gameplay-tag-attachment-compatibility.md) \* \[Setting up night vision\](/skgsfdocs/setup-guides/setting-up-night-vision.md) \* \[Holding other items\](/skgsfdocs/setup-guides/holding-other-items.md), such as a flashlight \* Animation: \[Creating a custom pose\](/skgsfdocs/setup-guides/creating-a-custom-pose.md) and \[Performing animations\](/skgsfdocs/setup-guides/performing-animations.md) ## Components Every component has its own page in the sidebar, with each of its settings, functions and events. \[Using the framework\](/skgsfdocs/getting-started/using-the-framework.md) covers how they connect and which one to call. ## Other \* \[Data Assets\](/skgsfdocs/getting-started/data-assets.md): Optional templates for sharing settings between Blueprints. \* \[Multiplayer\](/skgsfdocs/getting-started/multiplayer.md): What's sent to other players and what stays local. \* \[Projectiles\](/skgsfdocs/systems/projectiles.md): An optional, simple projectile system for firing bullets. \* \[Physical Materials\](/skgsfdocs/systems/physical-materials.md): Optional surface effects for footsteps and bullet impacts. \* \[Troubleshooting\](/skgsfdocs/getting-started/troubleshooting.md): Common problems and what to check. \* \[Updating to 2.0.0\](/skgsfdocs/getting-started/updating-to-2-0-0.md): For projects that used the framework before 2.0.0. ## Modules The plugin is split into modules. If you use the framework from C++, add the ones you need to your Build.cs. | Module | Contains | | ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | SKGShooterFramework | \[SKGShooterPawnComponent\](/skgsfdocs/components/skgshooterpawncomponent.md), \[SKGFirearmComponent\](/skgsfdocs/components/skgfirearmcomponent.md), \[SKGCharacterMovementComponent\](/skgsfdocs/components/skgcharactermovementcomponent.md) and the anim instance | | SKGShooterFrameworkCore | The SKG Shooter Framework developer settings and the infrared world subsystem used by the other modules | | SKGProceduralAnim | \[SKGProceduralAnimComponent\](/skgsfdocs/components/skgproceduralanimcomponent.md) and \[SKGOffhandIKComponent\](/skgsfdocs/components/skgoffhandikcomponent.md) | | SKGAttachment | \[SKGAttachmentComponent\](/skgsfdocs/components/skgattachmentcomponent.md) and \[SKGAttachmentManagerComponent\](/skgsfdocs/components/skgattachmentmanagercomponent.md) | | SKGOptic | \[SKGOpticComponent\](/skgsfdocs/components/skgopticcomponent.md) and \[SKGOpticSceneCaptureComponent\](/skgsfdocs/components/skgopticscenecapturecomponent.md) | | SKGMuzzle | \[SKGMuzzleComponent\](/skgsfdocs/components/skgmuzzlecomponent.md) | | SKGLightLaser | \[SKGLightLaserComponent\](/skgsfdocs/components/skglightlasercomponent.md) and \[SKGInfraredHandlerComponent\](/skgsfdocs/components/skginfraredhandlercomponent.md) | | SKGNightVision | \[SKGNightVisionComponent\](/skgsfdocs/components/skgnightvisioncomponent.md) | | SKGTemperature | \[SKGObjectTemperatureComponent\](/skgsfdocs/components/skgobjecttemperaturecomponent.md) | | SKGRangeFinder | \[SKGRangeFinderComponent\](/skgsfdocs/components/skgrangefindercomponent.md) | | SKGStock | \[SKGStockComponent\](/skgsfdocs/components/skgstockcomponent.md) | | SKGStats | \[SKGFirearmAttachmentStatComponent\](/skgsfdocs/components/skgfirearmattachmentstatcomponent.md) | | SKGProjectile | The projectile system, see \[Projectiles\](/skgsfdocs/systems/projectiles.md) | | SKGPhysicalMaterialModule | SKGPhysicalMaterial for surface impact and footstep effects, see \[Physical Materials\](/skgsfdocs/systems/physical-materials.md) | | SKGAnimGraphNodes | The Gameplay Tag Blend anim graph node | | SKGShooterFrameworkActors | SKGBaseActor, an actor with gameplay tags, and other base actor classes | | SKGShooterFrameworkEditor | Editor tools | | SKGOptional | An example character class. Can be ignored | ## Support Ask questions and get help on the \[Discord\](https://discord.gg/W5g6pZXfjh). --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/readme.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/data-assets.md). # Data Assets Every settings group on a component, such as the optic's Reticle Settings or the procedural anim's Recoil Settings, has a Data Asset field next to it. Leave it empty and the values set on the component are used. Set it and the whole group comes from the data asset instead. !\[An SKGProceduralAnim component with DA\\\_ProceduralAnimInitSettings\\\_Firearm set, so Initialization Settings is greyed out\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-197486c4c487c099e57cfdd82bedb4dbafc17ada%2Fdata-asset-set.png?alt=media) Data assets work as templates. Use one when several Blueprints should share the same settings, such as one recoil data asset for every M4 variant, or the same reticle settings on several optics. Change the data asset and every Blueprint using it picks up the change without having to make the change on each blueprint. These are entirely optional. ## Making a data asset 1. In the Content Browser, right-click and pick SKG > Data Assets. 2. Pick the category, then the settings group, from the table below. 3. Fill in the values. They're the same settings as on the component, so the component pages explain each one. 4. Set it in the group's Data Asset field on the component. !\[Right-click > SKG > Data Assets > Light Laser in the Content Browser\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-86729c7966152cdfc22aab70f258d9f37dfb6476%2Fcreate-menu.png?alt=media) The example project has some to start from in SKGSFCore/Data/ExampleProceduralSettings, such as DA\\\_RecoilSettings\\\_Example, and the poses in SKGSFExampleContent/Data/ProceduralSettings/Poses. ## Which data asset to make | Component | Settings group | SKG > Data Assets menu | | ----------------------------------------------------------------------------------------------- | --------------------------- | -------------------------------------------------------- | | \[SKGOpticComponent\](/skgsfdocs/components/skgopticcomponent.md) | Initialization Settings | Optic > Optic Initialization Settings | | | Reticle Settings | Optic > Optic Reticle Settings | | | Optic Zero Settings | Optic > Optic Zero Settings | | \[SKGProceduralAnimComponent\](/skgsfdocs/components/skgproceduralanimcomponent.md) | Initialization Settings | ProceduralAnim > Procedural Anim Initialization Settings | | | Aiming Settings | ProceduralAnim > Aiming Settings | | | Procedural Offsets | ProceduralAnim > Procedural Offsets Settings | | | Cycle Aiming Point Settings | ProceduralAnim > Cycle Aiming Point Settings | | | Movement Sway Settings | ProceduralAnim > Movement Sway Settings | | | Movement Lag Settings | ProceduralAnim > Movement Lag Settings | | | Rotation Lag Settings | ProceduralAnim > Rotation Lag Settings | | | Deadzone Settings | ProceduralAnim > Deadzone Settings | | | Recoil Settings | ProceduralAnim > Recoil Settings | | | Pose Settings | ProceduralAnim > Procedural Pose Settings, one per pose | | \[SKGOffhandIKComponent\](/skgsfdocs/components/skgoffhandikcomponent.md) | Initialization Settings | OffhandIK > OffhandIK Initialization Settings | | | Offhand IKSettings | OffhandIK > OffhandIK Settings | | \[SKGFirearmComponent\](/skgsfdocs/components/skgfirearmcomponent.md) | Firearm Stat Settings | Stats > Firearm Stat Settings | | | Firearm Collision Settings | Firearm > Firearm Collision Settings | | \[SKGFirearmAttachmentStatComponent\](/skgsfdocs/components/skgfirearmattachmentstatcomponent.md) | Attachment Stats | Stats > Firearm Attachment Stat Settings | | \[SKGMuzzleComponent\](/skgsfdocs/components/skgmuzzlecomponent.md) | Initialization Settings | Muzzle > Muzzle Initialize Settings | | | Muzzle Settings | Muzzle > Muzzle Settings | | \[SKGLightLaserComponent\](/skgsfdocs/components/skglightlasercomponent.md) | Initialization Settings | Light Laser > Light Laser Initialize Settings | | | Light Laser Settings | Light Laser > Light Laser Settings | | \[SKGRangeFinderComponent\](/skgsfdocs/components/skgrangefindercomponent.md) | Range Finder Settings | Range Finder > Range Finder Settings | | \[SKGObjectTemperatureComponent\](/skgsfdocs/components/skgobjecttemperaturecomponent.md) | Temperature Settings | Temperature > Object Temperature Settings | | \[SKGNightVisionComponent\](/skgsfdocs/components/skgnightvisioncomponent.md) | Tube Settings | Night Vision > Night Vision Tube Settings | | | Housing Settings | Night Vision > Night Vision Housing Settings | Attachment > Attachment Compatibility Settings makes the data assets for an attachment slot's Compatible Attachments, covered on the \[SKGAttachmentComponent\](/skgsfdocs/components/skgattachmentcomponent.md) page. ## While playing The \[SKGProceduralAnimComponent\](/skgsfdocs/components/skgproceduralanimcomponent.md) can swap a group for another data asset while playing and swap back, such as heavier sway while injured. See its Data Assets functions. Other components use their data assets when they initialize, so set the data asset before then, or call their Initialize function again afterward. --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/data-assets.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings.md). # Developer Settings The framework's project wide settings are in Project Settings > Plugins, split over four pages: SKG Shooter Framework, SKG Shooter Framework Attachment System, SKG Shooter Framework Optic Settings, and SKG Shooter Framework Temperature Settings. They're saved to DefaultGame.ini. The example project has all of them set up, so compare against it if something isn't working. ## SKG Shooter Framework !\[The SKG Shooter Framework settings in the example project\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-8c2ef7dab06691e19993eeda98af1873a06013fb%2Fmesh-forward-axis.png?alt=media) ### Procedural Animation \* \*\*Mesh Forward Axis\*\*: Which way every firearm and attachment mesh in your project faces, X Forward or Y Forward. Pick the one your assets use and keep it the same for all of them. The example's assets are Y Forward. Procedural settings and curves are always entered as X forward, Y right and Z up, so they work the same with either. See \[Setting up a firearm\](/skgsfdocs/setup-guides/setting-up-a-firearm.md). ### Firearm Collision \* \*\*Firearm Collision Channel\*\*: The trace channel used to push the firearm back when it runs into something, such as a wall. I recommend making a channel just for this in Project Settings > Engine > Collision, like the example's FirearmCollision trace channel with a Default Response of Block. Set anything the firearm shouldn't bump into to ignore it. ### Light Laser \* \*\*Laser Collision Channel\*\*: The trace channel lasers stop at. The laser dot is placed where it hits. The example uses its own Laser trace channel with a Default Response of Block. ### Range Finder \* \*\*Range Finder Collision Channel\*\*: The trace channel the \[SKGRangeFinderComponent\](/skgsfdocs/components/skgrangefindercomponent.md) measures with. The example uses the Laser channel for this too. ### Night Vision \* \*\*SKGSF Material Parameter Collection\*\*: Set to MPC\\\_SKGSF from SKGSFCore/Materials. The framework writes night vision, infrared, stencil and mesh forward axis values to it, and the optic, night vision and laser materials read them. ### Camera \* \*\*Allow SKGCamera FOVChanges\*\*: Lets the \[SKGShooterPawnComponent\](/skgsfdocs/components/skgshooterpawncomponent.md) zoom the camera while aiming, by the aiming settings' Camera Zoom Percentage or to the optic's magnification for magnified optics in Normal mode. Turn it off only if you change the camera's field of view yourself, since Normal mode optics won't zoom without it. \* \*\*Camera FOVInterpolation Speed\*\*: How fast the field of view changes, in degrees per second. 100 in the example. ### Custom Primitive Index Where values are written in a mesh's custom primitive data. The \[SKGLightLaserComponent\](/skgsfdocs/components/skglightlasercomponent.md) writes the laser's color, brightness, and infrared flag at these indices, and the \[SKGMuzzleComponent\](/skgsfdocs/components/skgmuzzlecomponent.md) writes the muzzle temperature. Your own Blueprints and C++ can get them with the matching Get function from the developer settings. The materials don't read these settings, so if you change one, change the matching parameter's index in your materials too. !\[The Custom Primitive Index settings\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-4e23a86508bd36e7d25a97b7c556983ee0202c0b%2Fcustom-primitive-index.png?alt=media) \* \*\*Laser Color Custom Primitive Index\*\*: 0. The laser color in M\\\_Laser\\\_Master and M\\\_LaserDot\\\_Master. \`GetLaserColorCustomPrimitiveIndex\`. \* \*\*Laser Brightness Custom Primitive Index\*\*: 4. The laser brightness in the same materials. \`GetLaserBrightnessCustomPrimitiveIndex\`. \* \*\*Is Infrared Custom Primitive Index\*\*: 5. Whether the mesh is infrared, read by MF\\\_InfraredMask in the laser materials, M\\\_LightBlinder and M\\\_EmissiveMaster. \`GetIsInfraredCustomPrimitiveIndex\`. \* \*\*Muzzle Temp Custom Primitive Index\*\*: 0. The muzzle temperature in M\\\_HeatUp\\\_Master. \`GetMuzzleTempCustomPrimitiveIndex\`. ## SKG Shooter Framework Attachment System Only used by the gameplay tag compatibility system, covered in \[Gameplay tag attachment compatibility\](/skgsfdocs/setup-guides/gameplay-tag-attachment-compatibility.md). \* \*\*Asset Types\*\*: The primary asset types \`GetCompatibleAttachmentsFromPrimaryAssets\` searches. \* \*\*Slot Compatibility Table List\*\*: The data tables that list which attachment tags each slot tag accepts, such as DT\\\_TagAttachmentCompatibilitySystem. !\[The attachment system settings with DT\\\_TagAttachmentCompatibilitySystem in Slot Compatibility Table List\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-7efe8c5ba0f8890975cbbb1b9eb401ad77ab59f9%2Fdeveloper-settings.png?alt=media) ## SKG Shooter Framework Optic Settings !\[The optic settings in the example project\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-d1cebbae0da365ed35c54ae1019491c403872225%2Foptic-settings.png?alt=media) \* \*\*Scene Capture GIMethod\*\* / \*\*Scene Capture Reflection Method\*\*: The global illumination and reflections used for the zoomed view of magnified optics in Picture in Picture. Lumen matches the player's view but costs more. None is much cheaper but the zoomed view can look darker or flatter than the scene around it. \* \*\*Digital Scene Capture GIMethod\*\* / \*\*Digital Scene Capture Reflection Method\*\*: The same for digital optics such as thermal scopes. None by default, since a digital screen doesn't need to match the scene exactly. \* \*\*Eyebox Eye Pupil Radius\*\*: The size of the player's eye in cm, 0.15 by default. The scope's image darkens as your eye moves off its exit pupil, and a bigger eye pupil makes that fade wider and more forgiving. \* \*\*Eyebox Exit Pupil Tolerance\*\*: Extra radius in cm added to every optic's exit pupil, making every scope's eyebox more forgiving without changing their specs. 0 by default. \* \*\*SharedViewFamily\*\*: Settings that render magnified optics as part of the player's own view for better performance. Covered in \[Setting up a magnified optic\](/skgsfdocs/setup-guides/setting-up-a-magnified-optic.md#shared-view-family). ## SKG Shooter Framework Temperature Settings \* \*\*Temperature MPC\*\* > \*\*Temperature Material Parameter Collection\*\*: Set to MPC\\\_SKGSF. The \[SKGObjectTemperatureComponent\](/skgsfdocs/components/skgobjecttemperaturecomponent.md) reads its thermal stencil range from it, so hot objects show up in thermal optics. !\[The temperature settings with MPC\\\_SKGSF\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-c0e65cd60ca47f95668f45db587aa3ac65e9d60d%2Ftemperature-settings.png?alt=media) --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/developer-settings.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/multiplayer.md). # Multiplayer The framework is built for multiplayer. This page sums up in short what is sent to other players and what each machine handles on its own. It does not cover everything but it should give you an idea. ## Requirements \* Turn on Replicates on your firearms, attachments, and devices such as night vision goggles. \* Call \`SetHeldActor\` on the server with whatever you are holding that uses the SKGSF system. ## Seen by every player These can be called on the client. They happen right away for that player and are sent to the server so everyone sees them: \* Aiming, leaning, free look, poses, and switching hands \* Cycling which aiming device you aim through \* Light and laser modes, night vision illuminator, and infrared mode on SKGInfraredHandler lights \* Folding the stock \* Adding and removing attachments. They're spawned on the server, and the owner can change them from the client if Allow Client Side Modification is enabled on the \[SKGAttachmentComponent\](/skgsfdocs/components/skgattachmentcomponent.md#attachment). Object temperature is set on the server and sent to everyone. Other players see poses with their Third Person Curve. ## Local only Each machine handles these on its own: \* Optics: the reticle, brightness, zoom, zero and the Picture in Picture image \* The night vision image, tubes and gain, and \`EnableInfraredMode\` \* Muzzle temperature, from that machine's \`ShotPerformed\` calls \* \[Projectiles\](/skgsfdocs/systems/projectiles.md) and the range finder \* Recoil, covered below ## Recoil Recoil only plays on the machine that calls \`PerformProceduralRecoil\` on the \[SKGShooterPawnComponent\](/skgsfdocs/components/skgshooterpawncomponent.md). Call it on the shooting player's machine for every shot. For other players to see that player's firearm kick, call it on their machines too, in the same place you play that player's shot for them. This could be when you play the firing sound or animation. The camera kick only applies to the shooting player. The example's BP\\\_PlayerPawn calls it when its firearm sends the Events.Firearm.Fire owner event. !\[BP\\\_PlayerPawn plays the recoil when its firearm sends the Events.Firearm.Fire owner event\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-2e414fdc24b5199ea8aa363d88988d8c3c8b7ccb%2Frecoil.png?alt=media) --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/multiplayer.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-firearm.md). # Setting up a firearm This guide builds a firearm you can hold, aim and shoot, like the example's BP\\\_M4 or BP\\\_BoltGun. Both are children of BP\\\_Firearm, which holds the components and shooting logic the example's firearms share. Optics, handguards, muzzle devices, and other attachments have their own guides. These were built to be very simple just using blueprints and manually adding components. For reference, in my personal projects and at work, these are all loaded async and constructed entirely from data. Set up the pawn and its animation blueprint first, as covered in \[Setting up a pawn\](/skgsfdocs/setup-guides/setting-up-a-pawn.md) and \[Setting up the animation blueprint\](/skgsfdocs/setup-guides/setting-up-the-animation-blueprint.md). ## 1. Mesh The firearm can be a static or skeletal mesh. Every firearm and attachment mesh in your project has to face the same way with either Y being the forward axis or X being the forward axis. It does not matter which forward direction you choose as long as it is consistent across your firearms and attachments. You can set the Mesh Forward Axis you are using in Project Settings > Plugins > SKG Shooter Framework to the direction your assets are. In the example project, the assets are Y forward. !\[SK\\\_BoltGun is Y forward: the green Y arrow points down the barrel and the blue Z arrow points up, with the pivot at the grip\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-2847865a24c0187a6367f16a930af80eb606d2a8%2Fforward-axis.png?alt=media) !\[Mesh Forward Axis and the other SKG Shooter Framework settings\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-8c2ef7dab06691e19993eeda98af1873a06013fb%2Fmesh-forward-axis.png?alt=media) ## 2. Sockets Add these sockets to the firearm's mesh. The names are the components' defaults, so you won't need to change them. | Socket | Where | Used by | | ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | | S\\\_Aim | In line with the sights, where the eye looks through them. It needs no rotation. | \[SKGProceduralAnimComponent\](/skgsfdocs/components/skgproceduralanimcomponent.md) | | S\\\_Muzzle | Just past the end of the barrel, with its X axis (red arrow) pointing out of the barrel. If the firearm has no barrel (such as the example M4, this is not needed). | \[SKGMuzzleComponent\](/skgsfdocs/components/skgmuzzlecomponent.md) | | S\\\_LeftHandIK | Where the left wrist sits when holding the firearm. It's the hand bone, not the palm. | \[SKGOffhandIKComponent\](/skgsfdocs/components/skgoffhandikcomponent.md) | | S\\\_RightHandIK | Optional. The same for the right hand when left-handed. | \[SKGOffhandIKComponent\](/skgsfdocs/components/skgoffhandikcomponent.md) | | S\\\_PointAimRightHandDominant / S\\\_PointAimLeftHandDominant | Optional. Where to aim from when point aiming, such as a canted aim, right- and left-handed. Set them in the SKGProceduralAnim component's point aim socket names. | \[SKGProceduralAnimComponent\](/skgsfdocs/components/skgproceduralanimcomponent.md) | A firearm with attachments, like the M4, also has a socket for each attachment slot, such as S\\\_Attachment\\\_Barrel. Those are covered in the attachment guide. An attachment with its own socket, such as a barrel's S\\\_Muzzle or a handguard's S\\\_LeftHandIK, takes over from the firearm's while it's attached. !\[SK\\\_M4's sockets, with its attachment slots and the barrel and pistol grip previewed\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-107c09d646f9fa05587a2d2bbc02cc964a22ed68%2Fsockets.png?alt=media) ## 3. Firearm Blueprint Create an Actor Blueprint and turn on Replicates for multiplayer. Add the mesh, then these components. Each one finds the mesh by name, so set its mesh name to your mesh component's name which is FirearmMeshComponent in the example. 1. \*\*SKGFirearm\*\*: Set Firearm Mesh Component Name. Leave Attachment Manager Component Name as None until you add attachments. See \[SKGFirearmComponent\](/skgsfdocs/components/skgfirearmcomponent.md) for firearm collision and stats. 2. \*\*SKGProceduralAnim\*\*: Set Procedural Mesh Name. This is where aiming, sway, lag, recoil and poses are set up. The example's settings in SKGSFCore/Data/ExampleProceduralSettings are a good start. See \[SKGProceduralAnimComponent\](/skgsfdocs/components/skgproceduralanimcomponent.md). 3. \*\*SKGMuzzle\*\*: Set Muzzle Mesh Component Name. See \[SKGMuzzleComponent\](/skgsfdocs/components/skgmuzzlecomponent.md). 4. \*\*SKGOffhandIK\*\*: Only if the offhand holds the firearm itself, like BP\\\_BoltGun. Set Offhand IKMesh Name and pick the left hand pose. A firearm with a handguard attachment, like the M4, gets it from the handguard instead. See \[SKGOffhandIKComponent\](/skgsfdocs/components/skgoffhandikcomponent.md). !\[BP\\\_M4's components. The ones with Edit in Blueprint come from BP\\\_Firearm, and the SKGAttachment ones are its attachment slots.\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-d45477a2fa29af6218055f02ea420c963a166fd5%2Fcomponents.png?alt=media) ## 4. Holding it Spawn the firearm, call \`SetHeldActor\` on the pawn's SKGShooterPawn component on the server, and attach the firearm to the pawn's mesh at ik\\\_hand\\\_gun. See the Holding something section in \[Setting up a pawn\](/skgsfdocs/setup-guides/setting-up-a-pawn.md). ## 5. Shooting The framework doesn't decide when to shoot. Your own logic, such as the example's BP\\\_Firearm, does. For each shot: 1. Fire the bullet from \`GetMuzzleProjectileTransform\` on the SKGFirearm component, with the \[projectile system\](/skgsfdocs/systems/projectiles.md) or your own. 2. Call \`ShotPerformed\` on the SKGFirearm component, for muzzle temperature if you wish to use it. 3. Call \`PerformProceduralRecoil\` on the pawn's SKGShooterPawn component on every player that should see the recoil as it is handled locally. See \[Recoil\](/skgsfdocs/getting-started/multiplayer.md#recoil) on the Multiplayer page. !\[BP\\\_Firearm's FireShot fires the projectile, plays the fire animation, calls Shot Performed and plays the muzzle effects\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-3113e988ac744803133d0125b74fd3cf6708deac%2Ffire-shot.png?alt=media) !\[BP\\\_PlayerPawn plays the recoil when its firearm sends the Events.Firearm.Fire owner event\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-2e414fdc24b5199ea8aa363d88988d8c3c8b7ccb%2Frecoil.png?alt=media) --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-firearm.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/gameplay-tag-attachment-compatibility.md). # Gameplay tag attachment compatibility Instead of listing every attachment that fits a slot in Compatible Attachments, slots and attachments can use gameplay tags. Each slot has a slot tag, each attachment has its own tags, and a table says which attachment tags each slot accepts. A new Picatinny optic then only needs the Attachment.Picatinny.Optic tag to fit every Picatinny optic slot in your game, instead of being added to every slot's list. This guide puts the example's holo sight, BP\\\_Optic\\\_HoloSight, on the M4's optic slot this way. ## 1. Gameplay tags Make two sets of tags, one for slots and one for attachments. The example keeps them in two data tables in SKGSFExampleContent/Data/DataTables/GameplayTags/AttachmentSystem: \* DT\\\_AttachmentSlots, such as AttachmentSlot.Picatinny.Optic and AttachmentSlot.M4.Barrel. \* DT\\\_Attachments, such as Attachment.Picatinny.Optic and Attachment.M4.Barrel. Gameplay tags are a hierarchy, so a slot that accepts Attachment.Picatinny accepts anything under it, such as Attachment.Picatinny.Optic and Attachment.Picatinny.Foregrip. The design was based around the idea where you make the tags around what physically fits, such as the rail type, rather than around each attachment. To make your own tables, create a Data Table with the GameplayTagTableRow structure, then add it to Gameplay Tag Table List in Project Settings > Gameplay Tags. !\[DT\\\_AttachmentSlots and DT\\\_Attachments with the example's slot and attachment tags\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-3787fb49b48b47390576030e8649b671fbc212bc%2Ftag-tables.png?alt=media) ## 2. Compatibility table Create a Data Table with the SKGAttachmentSlotCompatibility structure, like the example's DT\\\_TagAttachmentCompatibilitySystem. Add a row for each slot tag: \* \*\*Slot Tag\*\*: The slot this row is for, such as AttachmentSlot.Picatinny.Optic. \* \*\*Query\*\*: Which attachment tags fit this slot, edited in the Tag Query Editor. The example's AttachmentSlot.Picatinny.Optic row uses All Expressions Match with two expressions: Any Tags Match Attachment.Picatinny, and No Tags Match Attachment.Picatinny.Foregrip, Attachment.Picatinny.LightLaser and Attachment.Picatinny.OffsetPicatinny. Every Picatinny attachment fits except grips, lights and offset rails, so optics and optic mounts both go on the M4's optic rail. A slot whose tag has no row in any table accepts nothing. !\[DT\\\_TagAttachmentCompatibilitySystem with the AttachmentSlot.Picatinny.Optic row's query open in the Tag Query Editor\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-f6e157a18fb0c981dfcdbdc25456dfe3e93bfb28%2Fcompatibility-table.png?alt=media) Then add the table to Slot Compatibility Table List in Project Settings > Plugins > SKG Shooter Framework Attachment System. You can add more than one table, such as one per firearm family. Asset Types is only used by \`GetCompatibleAttachmentsFromPrimaryAssets\` and can be left alone. !\[The attachment system settings with DT\\\_TagAttachmentCompatibilitySystem in Slot Compatibility Table List\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-7efe8c5ba0f8890975cbbb1b9eb401ad77ab59f9%2Fdeveloper-settings.png?alt=media) ## 3. Attachments An attachment needs to implement the gameplay tags interface so the slot can read its tags. Blueprints can't implement it themselves, so reparent the attachment's Blueprint to SKGBaseActor in Class Settings > Parent Class. Your own C++ actor that implements IGameplayTagAssetInterface works too. Then add the attachment's tags to Gameplay Tags in its Class Defaults, such as Attachment.Picatinny.Optic on the holo sight. ## 4. Slots On the slot's \[SKGAttachment\](/skgsfdocs/components/skgattachmentcomponent.md) component, under Compatibility: \* Turn off Use Legacy Attachment System. \* Under GameplayTag, set Slot Tag to the slot's tag, such as AttachmentSlot.Picatinny.Optic on the M4's SKGAttachment\\\_Optic. Leave Slot Compatibility Override empty. It's for a one-off slot that isn't worth a table row: leave Slot Tag empty and fill in the override's own Slot Tag and Query instead. The override's Slot Tag only has to be set for the override to be used, and its Query is checked like a table row's. With both empty, the slot accepts any attachment that has the gameplay tags interface. An attachment without the interface never fits a slot using gameplay tags and an error is logged. !\[SKGAttachment\\\_Optic with Use Legacy Attachment System off, Slot Tag set to AttachmentSlot.Picatinny.Optic and Slot Compatibility Override left empty\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-17b7bd5005126987b9ce58cf562241f096f4510c%2Fslot-settings.png?alt=media) ## Finding what fits With gameplay tags the slot has no list of attachments, and \`GetCompatibleAttachments\` only reads Compatible Attachments. To show what fits a slot, such as in a customization menu, check each of your attachments with \`IsAttachmentClassCompatible\` on the slot. \`GetAttachmentComponentWithSlotTag\` on the \[SKGAttachmentManagerComponent\](/skgsfdocs/components/skgattachmentmanagercomponent.md) finds a slot by its Slot Tag. --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/gameplay-tag-attachment-compatibility.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-red-dot.md). # Setting up a red dot This guide sets up a non-magnified optic such as a red dot or holographic sight just like the example's BP\\\_Optic\\\_HoloSight and BP\\\_Optic\\\_MicroDot. Magnified optics have their own guide. An optic is an attachment, but you can also hold optics in your hand and aim with them procedurally all the same. ## 1. Mesh 1. I recommend having your own plane for the reticle so you can have glass on each side of the reticle. Make note of which material index this plane is on so the system can assign the reticle material to the correct material index. 2. Add an S\\\_Aim socket in the middle of the sight window, where the eye looks through. It needs no rotation. !\[Reticle material slot on the holographic sight\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-f055ab937618db5e978f0fd72f5a3efce3098687%2Freticle-index-holo.png?alt=media) !\[The S\\\_Aim socket on the holo sight, placed in the sight window\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-3a28d53d8a16498a12643d59549517b449423bfc%2Faim-socket.png?alt=media) ## 2. Optic Blueprint Create an Actor Blueprint and turn on Replicates for multiplayer. Add the optic's mesh, then these two components (SKGOptic is optional if you do not wish to alter the reticle at runtime). !\[BP\\\_Optic\\\_HoloSight's components: its mesh, SKGOptic and SKGProceduralAnim\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-7523a87e36d4d82935854ed85c1560bbd32621b2%2Fcomponents.png?alt=media) ### SKGOptic This component is optional. If you do not need the ability to change reticles or any feature that this component offers, you can simply not add it. Under Initialization Settings: \* Set Optic Mesh Name to the mesh (StaticMesh in this case). Set Optic Reticle Mesh Name to the same mesh unless the reticle is on a separate mesh as you will see in the magnified optic example. \* Set Reticle Distortion Type to Planar if you want reticle distortion. \* Leave Is Magnified off. Under Reticle Settings: \* Set Reticle Material Index to the reticle's material slot, 1 on the holographic sight. \* Set Reticle Material to M\\\_Reticle\\\_Master in SKGSFCore/Materials/Optic. Leave Normal Reticle Material empty, since it's only for magnified optics. \* Add a Reticle Texture with its size and colors. Add more to switch between them with \`CycleReticle\`. The holographic sight in the example has two, a red and a green version. \* Add the Reticle Brightness Settings, dimmest first, such as 25, 500 and 1000 in the example. \* Optional: turn on Supports Night Vision and add Reticle Night Vision Brightness Settings for much dimmer levels for use through \[night vision\](/skgsfdocs/setup-guides/setting-up-night-vision.md) such as 0.02, 0.08 and 0.2. Every setting is explained on the \[SKGOpticComponent\](/skgsfdocs/components/skgopticcomponent.md) page. !\[The holographic sight's Reticle Settings\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-6f7ced8aeeeb052868602d590d4f777e0a9c9090%2Freticle-settings.png?alt=media) ### SKGProceduralAnim Set Procedural Mesh Name to the optic's mesh. Procedural Aim Socket Names already holds S\\\_Aim. On an attachment, only the Initialization Settings and a few Aiming Settings are used, such as Aiming Distance. Everything else comes from the firearm. See \[SKGProceduralAnimComponent\](/skgsfdocs/components/skgproceduralanimcomponent.md). --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-red-dot.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-handguard-and-forward-grip.md). # Setting up a handguard and forward grip This guide sets up where the offhand holds the firearm such as the example's BP\\\_M4\\\_Handguard and BP\\\_Foregrip\\\_AFG. When you see Offhand, that is referring to either the left hand or the right hand. If you are in Right handed mode (default) then the Offhand is the left hand. Both use the \[SKGOffhandIKComponent\](/skgsfdocs/components/skgoffhandikcomponent.md), which is optional. Without it, you can use a normal animation for holding the item. ## How the offhand picks what to hold The firearm, handguard, and forward grip can each have an \[SKGOffhandIKComponent\](/skgsfdocs/components/skgoffhandikcomponent.md). The \[SKGFirearmComponent\](/skgsfdocs/components/skgfirearmcomponent.md) uses the one with the highest Offhand IKTag: Forward Grip, then Handguard, then Firearm. On the M4 the hand holds the handguard until a forward grip is added, and goes back to the handguard when the grip is removed. A firearm with a built-in handguard puts its SKGOffhandIK on the firearm with the Firearm tag. ## 1. Mesh Add an S\\\_LeftHandIK socket where the left hand goes when right-handed. The socket is where the hand bone goes, so place it where the wrist should be when holding the grip. If the firearm can be used left-handed, also add S\\\_RightHandIK for the right hand. The handguard has both even though the example project does not use the switching hands feature, the forward grips only S\\\_LeftHandIK. !\[S\\\_LeftHandIK and S\\\_RightHandIK on the M4 handguard, off to the sides where the hand bones sit\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-e8a6d7a7d470df93999beda2373b7b7b3830694b%2Fhandguard-hand-socket.png?alt=media) !\[S\\\_LeftHandIK on the AFG, off to the side where the hand bone sits\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-00e64b0a2377ce4efb2436a9520871f569c6598f%2Fhand-socket.png?alt=media) ## 2. Grip pose Each SKGOffhandIK has a grip pose: a one frame animation that only poses the offhand. A vertical grip and an angled grip need different hand poses, so each grip has its own. The example's grip poses are AS\\\_Character\\\_AFGGrip, AS\\\_Character\\\_VerticalGrip and AS\\\_Character\\\_StubbyVerticalGrip in SKGSFExampleContent/Animation/MannyAnimations/GripPoses. The handguard uses the M4's idle animation, AS\\\_Character\\\_M4\\\_Idle, since the hand already holds the handguard in it. ## 3. Handguard Add an SKGOffhandIK component to the handguard. Under Initialization Settings: \* Set Offhand IKTag to Handguard. \* Set Offhand IKMesh Name to the handguard's mesh (StaticMesh in the example project). \* Left Hand IKSocket Name and Right Hand IKSocket Name already hold S\\\_LeftHandIK and S\\\_RightHandIK. Under Offhand IKSettings, set Left Hand IKPose to the grip pose, AS\\\_Character\\\_M4\\\_Idle on the M4. Set Right Hand IKPose too if the firearm can be used left-handed. !\[BP\\\_M4\\\_Handguard's SKGOffhandIK settings\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-69a770962f2faffd023b795bebc12bb6278a9715%2Fhandguard-offhand-ik.png?alt=media) The handguard's rail slots are covered in \[Setting up attachments\](/skgsfdocs/setup-guides/setting-up-attachments.md). The forward grips go on its bottom rail. ## 4. Forward grip Create the forward grip as an attachment with its mesh, then add an SKGOffhandIK component. Under Initialization Settings: \* Set Offhand IKTag to Forward Grip. \* Set Offhand IKMesh Name to the grip's mesh (StaticMesh). Under Offhand IKSettings, set Left Hand IKPose to the grip's pose such as AS\\\_Character\\\_AFGGrip for the AFG. !\[BP\\\_Foregrip\\\_VerticalGrip's components: its mesh and SKGOffHandIK. Every example grip is set up this way.\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-484508ed9042162a0c57442f6512e2f2d5e1a219%2Fforward-grip-components.png?alt=media) !\[BP\\\_Foregrip\\\_AFG's SKGOffhandIK settings, tagged as a forward grip with the AFG grip pose\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-14936dfcddc34dad02da1e0a743caaef8c473c8c%2Fdetails-panel.png?alt=media) ## Left-handed The right hand settings are only used if the firearm has Can Use Left Hand Dominate on its \[SKGProceduralAnimComponent\](/skgsfdocs/components/skgproceduralanimcomponent.md). Leave them empty if your game is right-handed only. --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-handguard-and-forward-grip.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-magnified-optic.md). # Setting up a magnified optic This guide sets up a magnified optic such as an LPVO or long range scope such as the example's BP\\\_Optic\\\_LPVO. It builds on \[Setting up a red dot\](/skgsfdocs/setup-guides/setting-up-a-red-dot.md), so read that first. Reticle textures and brightness work the same way and aren't repeated here. ## Picture in Picture or Normal Magnified optics can zoom in two ways, and players can switch between them while playing, like in Insurgency: Sandstorm and Wardogs. \* \*\*Picture in Picture\*\*: The zoomed view is rendered onto the lens while everything around the scope stays at normal zoom, like a real scope. Rendering the scene a second time costs more performance, but a lot of work has gone into making these optics look and perform better than any other optic asset on the marketplace. Only the part of the screen the lens covers is rendered, the image is drawn onto the lens in post process using a stencil so it stays sharp, and the \[shared view family\](#shared-view-family) can render it as part of the player's own view instead of as a separate render. \* \*\*Normal\*\*: The camera zooms in, optionally with part of the zoom done inside the lens to give it a magnified look. This is the traditional way and costs less. The mode is stored per player and starts on Picture in Picture. Set it by calling \`SetMagnifiedOpticMode\` on the \[SKGShooterPawn component\](/skgsfdocs/components/skgshooterpawncomponent.md), such as from your settings menu. It isn't saved for you, so save it with the rest of your game's settings and set it again when the game starts. In the example, IA\\\_TogglePiP in BP\\\_PlayerPawn calls \`SetMagnifiedOpticMode\` to switch between the two. !\[Aiming the LPVO in Picture in Picture (left), where only the lens zooms, and Normal (right), where the camera zooms in too\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-d00881deb3ec02d3c27343213cad88fa9720ddc5%2Fpip-vs-normal.png?alt=media) ## 1. Mesh The example LPVO is made of three meshes. I recommend a separate mesh for the reticle plane as in the example. The lens masking then only has to work with that one mesh, which keeps it cleaner. This is optional and the entire scope can be 1 mesh. If your reticle is on the scope body instead, put both sockets on the body: \* \*\*SM\\\_Optic\\\_LPVO\*\*, the scope body. Add an S\\\_ObjectiveLens and S\\\_SceneCapture socket at the center of the front lens. \* \*\*SM\\\_Optic\\\_LPVO\\\_ReticlePlane\*\*, a plane at the rear lens that shows the reticle. In Picture in Picture it displays the zoomed image. The reticle is on material slot 0. Add an S\\\_RearLens socket at the center of the rear lens with its X axis (red arrow) pointing out the front of the scope, which is a Yaw of 90 on the example's Y-forward mesh. Place it right on the plane's surface, since the zoomed image is only drawn close to it (see Lens Plane Depth Tolerance below). Add the S\\\_Aim socket here too, as in the red dot guide. \* \*\*SM\\\_Optic\\\_LPVOOcular\*\*, the eyepiece glass. It's only a separate mesh so it can turn as you zoom like a real one, which the example does from the On Magnification Changed event. This is optional and it can be part of the scope body. The eyebox and field stop are centered on S\\\_RearLens, and Picture in Picture renders the zoomed view from S\\\_ObjectiveLens. If either socket is missing, an error is logged when the optic starts. !\[S\\\_RearLens on the LPVO's reticle plane, with its X axis pointing out the front\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-f9ff35c2f6f8551fa528256f20526c61f842524a%2Frear-lens-socket.png?alt=media) !\[S\\\_ObjectiveLens at the center of the LPVO's front lens\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-5bf2950271bb17fc1ff544c46803edbee92d67ec%2Fobjective-lens-socket.png?alt=media) ## 2. Optic Blueprint Create an Actor Blueprint and turn on Replicates for multiplayer. Add the scope body and attach the reticle plane and eyepiece to it. The example names them StaticMesh, StaticMeshReticle and StaticMeshOcular. Then add these components: \* \*\*SKGOptic\*\* \* \*\*SKGProceduralAnim\*\* \* \*\*SKGOpticSceneCapture\*\*, attached to the scope body at S\\\_SceneCapture. Only needed for Picture in Picture. !\[StaticMeshReticle attached to the scope body, sitting at the rear lens\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-29b73256d00880b1708a82d5004ad6a3e25f6b50%2Fstatic-mesh-reticle.png?alt=media) ### SKGOptic Every setting is explained on the \[SKGOpticComponent\](/skgsfdocs/components/skgopticcomponent.md) page. These are the ones a magnified optic needs. Under Initialization Settings, set Optic Mesh Name to the scope body (StaticMesh) and Optic Reticle Mesh Name to the reticle plane (StaticMeshReticle). !\[BP\\\_Optic\\\_LPVO's components and the SKGOptic Initialization Settings\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-f7d4869cc16ad9b46f869435bf5988c8e96a9905%2Fcomponent-names.png?alt=media) Under Quality Settings: \* Set Reticle Distortion Type to Spherical, so the reticle bends with the round lens. \* Lens Distortion Strength bends the image at the edge of the lens, and Lens Distortion Start Offset sets where that starts. Set Lens Distortion Strength to 0 to turn it off. !\[The LPVO's Quality Settings\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-933efe771e0d7c2bc6e56f2654491bed6e4eddca%2Fquality-settings.png?alt=media) Under Magnification Settings: \* Turn on Is Magnified. \* Add your zoom levels to Magnifications, lowest first, to step through them with \`ZoomIn\` and \`ZoomOut\`. To zoom freely between two values instead, turn on Use Min Max Magnification and set Min Magnification and Max Magnification. The LPVO does this, from 1 to 8. \* Turn on Is First Focal Plane if the reticle should grow as you zoom in. Leave it off for a second focal plane scope, where the reticle stays the same size. \* Optional: Smooth Zoom changes the magnification gradually instead of instantly. !\[The LPVO's Magnification Settings\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-7b92c0e7d45a91dbd9a4b67d17c748903a0d69af%2Fmagnification-settings.png?alt=media) Under Scene Capture Settings, for Picture in Picture: \* Set Optic Scene Capture Component Name to the name of the SKGOpticSceneCapture component. \* Turn on Composite in Post Process and set Post Process Composite Material to PPM\\\_MagnifiedOpticBeforeBloom. This draws the image onto the lens in post process, using a stencil to find the lens, so it stays sharp. The rest can stay at their defaults, but these are worth knowing: \* \*\*Size Render Target to Lens\*\*: Leave this on. Instead of rendering the whole screen and only showing the middle, the scope image is only rendered as big as the lens appears on screen at its widest field of view. This is a big part of what keeps Picture in Picture cheap. \* \*\*Lens Coverage Margin\*\*: How much extra area around the lens gets rendered when Size Render Target to Lens is on. 1 renders exactly the opening of the field stop (the dark ring), and 1.2 renders 20% more. Raise it slightly if the image repeats or smears at the edge of the lens, which can happen with your eye off center or strong lens distortion. The render target grows with it, so keep it as low as looks right. The LPVO uses 1. \* \*\*Min Render Target Size\*\* / \*\*Max Render Target Size\*\*: Limits for that render target's size, in pixels. 256 and 2048 on the LPVO. \* \*\*Tick Frequency\*\* / \*\*Tick Interval\*\*: Skip captures to save performance, at the cost of a less smooth scope image. 0 renders every frame. \* \*\*Custom Depth Stencil Value\*\*: The stencil value put on the reticle mesh while aiming, so the post process can find the lens on screen. 0 automatically sets it. Don't use the \[night vision\](/skgsfdocs/setup-guides/setting-up-night-vision.md) stencil value (25 by default). \* \*\*Lens Plane Depth Tolerance\*\*: The zoomed image is only drawn on pixels that have the stencil and are within this distance of the reticle plane in cm. The reticle plane goes through S\\\_RearLens and faces along its X axis, so S\\\_RearLens has to sit right on the surface of your reticle plane. If it's further away than the tolerance, the lens shows only part of the image or none at all. Raise it if your reticle plane is curved. Keep it small otherwise so other parts of the reticle mesh near the lens, such as the eyepiece rim when the whole scope is one mesh, don't get the image drawn on them. The LPVO uses 0.25 cm. \* \*\*Reticle Plane Socket Name\*\* / \*\*Reticle Plane Forward Offset\*\*: Use a socket on the scope body for the reticle plane instead of S\\\_RearLens, or move the plane forward. The LPVO's mesh doesn't have an S\\\_ReticlePlane socket, so it uses S\\\_RearLens. !\[The LPVO's Scene Capture Settings\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-a878f6d8977159340cbd3e0301c6f68ec242f1cb%2Fscene-capture-settings.png?alt=media) Under Normal Scope Settings, for Normal: \* Set Zoom Post Process Material to PPM\\\_NormalScopeZoom. It draws the lens effects and the zoom inside the lens. \* In Scope Zoom Share sets how much of the zoom happens inside the lens. The rest comes from zooming the camera. The LPVO uses 0.25 so 1/4 of the magnification comes from inside of the scope and the rest from the camera. Using to high of a value here can cause the image inside of the scope to become blurry as it is zooming in on the pixels. \* Aperture Radius is the radius of the lens opening, 1.65 cm on the LPVO. Parts of the scope inside it are hidden while aiming via the MF\\\_NormalScopeCutout mask so they don't block your view. See step 3 below. \* Aperture Socket Name is the socket the opening is centered on. If the scope body doesn't have that socket, S\\\_RearLens is used, as on the LPVO. !\[The LPVO's Normal Scope Settings\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-bd72d8ad0624ccd428e12b71cda8bb37875e7fed%2Fnormal-scope-settings.png?alt=media) Under Field Stop Settings and Eye Relief Settings, enter the values from your scope's spec sheet. The LPVO sees 110 ft at 1x and 13.1 ft at 8x at 100 yards, with 3.7 in of eye relief and a 24 mm objective lens. !\[The LPVO's Field Stop Settings\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-9204634372906c8dfce67e12943b5e579f6049c8%2Ffield-stop-settings.png?alt=media) !\[The LPVO's Eye Relief Settings\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-c5e0741021be29ac487e561cdd4dfb7fea67dcbd%2Feye-relief-settings.png?alt=media) Under Reticle Settings: \* Set Reticle Material Index to the reticle plane's slot, 0 on the LPVO. \* Set Reticle Material to M\\\_MagnifiedScope\\\_Master in SKGSFCore/Materials/Optic. This one is used in Picture in Picture. \* Set Normal Reticle Material to M\\\_NormalScope\\\_Master. Normal mode doesn't work without it. \* Add your Reticle Textures and brightness levels the same way as on a red dot. !\[The LPVO's Reticle Settings\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-d6a8d3da3db8d9a1c4cf2b59b277fee2306b4597%2Freticle-settings.png?alt=media) Under Optic Zero Settings, pick MRAD or MOA for Adjustment Type and how far one click moves the point of impact. The LPVO uses .1 MRAD. !\[The LPVO's Optic Zero Settings\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-d8c4aa6511794d72be775cd59dcfef263e9363e9%2Fzero-settings.png?alt=media) ### SKGOpticSceneCapture Attach it to the scope body (I use a S\\\_SceneCapture socket), facing forward along the scope, and give it the name you set in Optic Scene Capture Component Name. See \[SKGOpticSceneCaptureComponent\](/skgsfdocs/components/skgopticscenecapturecomponent.md). !\[SKGOpticSceneCapture attached to the scope body, facing forward\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-e7a428762087ae0d9f864da4a6591c35df31abe4%2Fscene-capture-setup.png?alt=media) ### SKGProceduralAnim Set it up the same way as on a red dot, with Procedural Mesh Name set to the mesh that has the S\\\_Aim socket, StaticMeshReticle on the LPVO. See \[SKGProceduralAnimComponent\](/skgsfdocs/components/skgproceduralanimcomponent.md). !\[The LPVO's SKGProceduralAnim Initialization Settings\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-0d5c59bbfb59e204ac2a3bb5b7b8783a48cea6b0%2Fprocedural-anim.png?alt=media) ## 3. Hide meshes inside the lens in Normal mode In Normal mode, parts of the scope, firearm, and hands seen through the lens opening are hidden via a mask while aiming so they don't block the zoomed view. Only materials that use MF\\\_NormalScopeCutout are hidden. The example's M\\\_Master and M\\\_Mannequin already use it in the example. I recommend only applying the mask to your own character and firearm parts so you do not have masked materials on every character and firearm and attachment. Skip this step if you only use Picture in Picture. To add it to your own material: 1. Set Blend Mode to Masked. 2. Add MF\\\_NormalScopeCutout and plug its KeepMask output into Opacity Mask. If the material already has an opacity mask, multiply the two together. !\[MF\\\_NormalScopeCutout plugged into Opacity Mask in M\\\_Master\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-7981465a04333ce1267f0ff17156bcfdd13ea307%2Fcutout-material.png?alt=media) ## 4. Zoom and zero Call these on the \[SKGOpticComponent\](/skgsfdocs/components/skgopticcomponent.md). You can get it with \`GetCurrentOpticComponent\` on the \[SKGFirearm component\](/skgsfdocs/components/skgfirearmcomponent.md). The example's BP\\\_PlayerPawn binds them to inputs. \* \`ZoomIn\` / \`ZoomOut\` change the magnification (IA\\\_ZoomIn and IA\\\_ZoomOut). \* \`PointOfImpactUp\`, \`PointOfImpactDown\`, \`PointOfImpactLeft\` and \`PointOfImpactRight\` dial in clicks like turning the turrets (IA\\\_PointOfImpact\\\_Up and so on). \* To zero for a distance in one call, use \`ZeroOpticsForZeroAtLocation\` on the SKGFirearm component with the location the bullet reaches at that distance. You can get that location from \`GetProjectileLocationAtDistance\` on the SKGProjectileWorldSubsystem. In Normal mode the zero moves the bullet instead of the scope image, so fire bullets from \`GetMuzzleProjectileTransform\` on the SKGFirearm component as covered in \[Setting up a firearm\](/skgsfdocs/setup-guides/setting-up-a-firearm.md). ## Shared view family Picture in Picture only and optional. By default the zoomed view comes from a scene capture, which renders the whole scene again every frame as its own separate render, with its own scene setup, shadows, and lighting. The shared view family adds the zoomed view to the player's own render as a second view instead, so work that has to be done once per frame is shared between the two. In the example map this brought the cost of aiming the LPVO down from about 3.3 ms to 1.9 ms per frame. It's still being tested, so try it in your project before shipping with it. Turn it on in Project Settings > Plugins > SKG Shooter Framework Optic Settings, under SharedViewFamily. The example project has it on. \* \*\*Use Shared View Family for Magnified Optics\*\*: Turns it on. The optic needs Composite in Post Process on under its Scene Capture Settings. \* \*\*Shared View Max Shadow Cascades\*\*: How many shadow cascades the zoomed view renders. Lower is cheaper. It only affects cascaded shadow maps, not virtual shadow maps. The example uses 1. \* \*\*Keep Scene Textures Grown\*\*: Leave this on. The zoomed view makes the renderer's screen textures bigger, and without this they're thrown away and made again every time you aim and stop aiming, which causes a hitch. It keeps about 200 MB of extra video memory at 1440p. \* \*\*Disable Lumen Hardware Ray Tracing\*\*: UE 5.5 and 5.6 only. Those versions switch Lumen from hardware to software ray tracing while aiming, which changes the lighting and adds a few ms when you stop aiming. Turn this on to keep Lumen on software ray tracing the whole time instead. Not needed on 5.7 and newer, or if your project doesn't use hardware ray tracing. \* \*\*Idle Transient Heap Reservation MB\*\*: Keeps video memory reserved while not aiming so aiming again doesn't have to allocate it. 0 turns it off. Leave it at 128. !\[The SharedViewFamily settings in the example project: on, with 1 shadow cascade, Keep Scene Textures Grown on and 128 MiB reserved\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-048450a378891e7fcf052a0e623746a64daedfc9%2Fshared-view-settings.png?alt=media) To avoid a hitch the first time a player aims, call \`WarmUpSharedView\` on the \[SKGOpticSceneCaptureComponent\](/skgsfdocs/components/skgopticscenecapturecomponent.md) at a quiet moment, such as after equipping the weapon. The scene capture is used instead when HDR output is on, when the optic has Composite in Post Process off, or when the player's view uses Screen Space Global Illumination. Multiplayer PIE with Run Under One Process isn't supported, but packaged and standalone builds work. ## Digital and thermal optics The example's BP\\\_Optic\\\_Thermal is a digital thermal sight. Turn on Is Digital under Scene Capture Settings so the image comes from where SKGOpticSceneCapture is placed, like a camera feeding a screen. Add thermal color palettes such as PPMI\\\_Thermal\\\_WhiteHot to Weighted Blendables under Reticle Settings, and switch between them with \`CycleNextWeightedBlendable\`. Weighted Blendables only work in Picture in Picture. --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-magnified-optic.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-muzzle-device.md). # Setting up a muzzle device This guide sets up a barrel, muzzle device such as a flash hider, and a suppressor. The example projects BP\\\_M4\\\_Barrel, BP\\\_MuzzleDevice\\\_FlashHider, and BP\\\_MuzzleDevice\\\_Suppressor all use the \[SKGMuzzleComponent\](/skgsfdocs/components/skgmuzzlecomponent.md), which marks where bullets leave from and where firearm collision is checked to. ## How the firearm picks the muzzle The barrel, muzzle device and suppressor can each have an \[SKGMuzzleComponent\](/skgsfdocs/components/skgmuzzlecomponent.md). The \[SKGFirearmComponent\](/skgsfdocs/components/skgfirearmcomponent.md) uses the one with the highest Muzzle Tag: Suppressor, then Muzzle Device, then Barrel. On the M4 the barrel takes a flash hider or the oil filter suppressor, and the flash hider takes the suppressor. Add the suppressor and the bullets leave from the end of the suppressor. A firearm with a built-in barrel puts its SKGMuzzle on the firearm with the Barrel tag. ## 1. Mesh Add an S\\\_Muzzle socket just past the end of the muzzle, with its X axis (red arrow) pointing out of the barrel, the direction the bullet travels. A part that something else attaches to also needs a socket for that slot. The flash hider has S\\\_Attachment\\\_Muzzle for the suppressor. !\[The S\\\_Muzzle socket just past the end of the suppressor, with the red X arrow pointing out of the barrel\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-5d6932b459307038dd2849ade651a806b281344b%2Fmuzzle-socket.png?alt=media) !\[The flash hider's S\\\_Muzzle and S\\\_Attachment\\\_Muzzle sockets\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-8cb116ae9791981e3d5c2d507359c8eed1134f54%2Fflash-hider-sockets.png?alt=media) ## 2. Barrel Add an SKGMuzzle component to the barrel. Set Muzzle Mesh Component Name to the barrel's mesh (StaticMesh) and Muzzle Tag to Barrel. Muzzle Socket Name already holds S\\\_Muzzle. BP\\\_M4\\\_Barrel also has an SKGAttachment slot, SKGAttachment\\\_Muzzle, for muzzle devices. Its compatibility list, DA\\\_Compatibility\\\_M4\\\_BarrelAttachment, has the flash hider and the oil filter suppressor. !\[BP\\\_M4\\\_Barrel's components: its mesh, the SKGAttachment\\\_Muzzle slot for a muzzle device, and SKGMuzzle\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-e9d4aa5e0a44a58d445e13ac52f0cdcd7ef5e90d%2Fbarrel-components.png?alt=media) ## 3. Muzzle device Add an SKGMuzzle component to the muzzle device the same way, with Muzzle Tag set to Muzzle Device. The flash hider also has an SKGAttachment slot on S\\\_Attachment\\\_Muzzle, with the suppressor in its compatibility list, DA\\\_Compatibility\\\_MuzzleDevice\\\_FlashHider. !\[BP\\\_MuzzleDevice\\\_FlashHider's components\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-4c3316b7786115795f8b5c68fd7988ba35d240eb%2Fflash-hider-components.png?alt=media) !\[The flash hider's SKGMuzzle settings, tagged as a muzzle device\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-1924a57ceef551468756a9f4fd3cd2c64bcfe0ab%2Fflash-hider-muzzle-settings.png?alt=media) ## 4. Suppressor Add an SKGMuzzle component with Muzzle Tag set to Suppressor. The example's suppressor goes on the flash hider, while BP\\\_MuzzleDevice\\\_OilFilterSuppressor goes straight on the barrel. !\[BP\\\_MuzzleDevice\\\_Suppressor's SKGMuzzle settings, tagged as a suppressor with the temperature system on\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-2772496dce699c46b0fa90b296f21154103c648b%2Fdetails-panel.png?alt=media) ## 5. Muzzle temperature Optional. The example suppressor heats up as you shoot, glows, and shows up hot through \[thermal optics\](/skgsfdocs/setup-guides/setting-up-a-magnified-optic.md#digital-and-thermal-optics). 1. Turn on Use Muzzle Temperature System and set Muzzle Temp Curve, C\\\_MuzzleTemp\\\_Suppressor in the example. Increase Muzzle Temperature Amount sets how much each shot heats it, and Decrease Muzzle Temperature Amount Per Tick how fast it cools. See \[SKGMuzzleComponent\](/skgsfdocs/components/skgmuzzlecomponent.md) for how the curve works. 2. Call \`ShotPerformed\` on the SKGFirearm component for every shot, as covered in \[Setting up a firearm\](/skgsfdocs/setup-guides/setting-up-a-firearm.md). 3. For the glow, put a material that reads the temperature from custom primitive data on the mesh such as MI\\\_MuzzleDevice\\\_Suppressor\\\_HeatUp (made from M\\\_HeatUp\\\_Master). The component writes the temperature to the mesh's custom primitive data every time it changes at Muzzle Temp Custom Primitive Index (0) in the \[developer settings\](/skgsfdocs/getting-started/developer-settings.md#custom-primitive-index). 4. For thermal optics, turn on Auto Handle Muzzle Thermal Stencil Value, and turn on Render CustomDepth Pass on the mesh. !\[C\\\_MuzzleTemp\\\_Suppressor, rising from 0 at 25 to 800 at 100\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-0cd60634b52781d341271478a7f1c56f523abf1f%2Ftemperature-curve.png?alt=media) --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-muzzle-device.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-light-and-laser.md). # Setting up a light and laser This guide sets up a weapon light and laser like the example's BP\\\_LightLaser which goes on the M4 through BP\\\_LightLaserMount\\\_45Offset. It uses the \[SKGLightLaserComponent\](/skgsfdocs/components/skglightlasercomponent.md). A device can be just a light, a laser, or both. ## 1. Mesh Add an S\\\_Light socket where the light comes out and an S\\\_Laser socket where the beam comes out. The light and laser components attach to them. !\[The S\\\_Light and S\\\_Laser sockets on SM\\\_LightLaser\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-a514c7b2f55b6ce00cc7141cb4a3287dca213834%2Flight-laser-sockets.png?alt=media) ## 2. Light and laser Blueprint Add these components to the attachment: \* The device's body mesh such as an NGAL or flashlight. \* A \*\*Spot Light\*\*, attached to S\\\_Light. Skip it for a laser only device. \* A \*\*laser beam\*\* mesh attached to S\\\_Laser and a \*\*laser dot\*\* mesh. Use SM\\\_Laser and SM\\\_LaserDot from SKGSFCore/LightLaser, which come with M\\\_Laser\\\_Master and M\\\_LaserDot\\\_Master on them. The beam is stretched along its Y axis to whatever it hits, and the dot is moved to the hit. Skip both for a light only device. \* An \*\*SKGLightLaser\*\* component. !\[BP\\\_LightLaser's components, with LaserMesh, LaserDot and SpotLight found by name\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-ed1794d836ab469af07e7c8c9710c46bfc6f2291%2Fcomponents.png?alt=media) ### SKGLightLaser Every setting is explained on the \[SKGLightLaserComponent\](/skgsfdocs/components/skglightlasercomponent.md) page. These are the ones to set. Under Initialization Settings: \* Set Light Component Name, Laser Mesh Component Name, and Laser Dot Component Name to your component names. Leave a name as None if the device doesn't have that part. A laser requires a laser mesh and dot mesh. \* Optional: turn on Has Infrared Mode and set Infrared Light Function Material to M\\\_IRLightFunction so the light and laser can switch to infrared and only show through night vision if you wish it to support infrared mode. Infrared only shows for a player while infrared mode is on, covered in \[Setting up night vision\](/skgsfdocs/setup-guides/setting-up-night-vision.md). !\[BP\\\_LightLaser's Initialization Settings\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-5d5f5078162d9630c99275cdbc915f6a87ab32ed%2Finitialization-settings.png?alt=media) Under Laser Settings: \* Pick a Laser Color and brightness. \* Leave Laser Scale Factor at 20 when using SM\\\_Laser. !\[BP\\\_LightLaser's Laser Settings\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-45099f6dd65903d9dac0e19a2e0f3d699d6e2eea%2Flaser-settings.png?alt=media) The color and brightness are sent to the beam and dot meshes as custom primitive data at the indices in the \[developer settings\](/skgsfdocs/getting-started/developer-settings.md#custom-primitive-index). Under Light Settings, add the brightness levels to Light Intensities, such as 2, 6 and 12 in the example. !\[BP\\\_LightLaser's Light Settings, with three brightness levels\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-c5c86595dfcb2c9a8ec3c50052b63f86ecc853ad%2Flight-settings.png?alt=media) Laser Cycle Modes and Light Cycle Modes set which modes the device steps through, such as off, on, infrared and strobe. The defaults work for most devices. !\[The default Laser Cycle Modes and Light Cycle Modes\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-1871796f58b200dbf1749bc93a491e46377a3304%2Fcycle-modes.png?alt=media) ## 3. Controls To control every light and laser on the firearm at once, call these on the \[SKGFirearmComponent\](/skgsfdocs/components/skgfirearmcomponent.md). The example's BP\\\_PlayerPawn gets it with \`GetCurrentFirearmComponent\` on the \[SKGShooterPawn component\](/skgsfdocs/components/skgshooterpawncomponent.md) and binds them to inputs: \* \`ToggleAllLights\` (IA\\\_ToggleLight) \* \`ToggleAllLasers\` (IA\\\_ToggleLaser) \* \`ToggleAllLightsStrobe\` (IA\\\_ToggleLightStrobe) \* \`CycleAllLightsIntensity\` (IA\\\_CycleLightIntensity) \* \`SetAllLightLaserInfraredMode\` (IA\\\_ToggleInfraredMode) To control one device, call the functions on its SKGLightLaser component instead. These can be called on the client, and every player sees the change. !\[BP\\\_PlayerPawn's laser, light and strobe inputs calling the SKGFirearm component\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-84964d62899f283dba727145a1082ecaf4dd245c%2Fpawn-light-inputs.png?alt=media) ## Lens glow Optional, and only part of the example. BP\\\_LightLaser makes the light look on with the Blinder, an emissive mesh (SM\\\_Flashlight\\\_BlinderSource) that adds bloom in front of the lens. Its material, M\\\_LightBlinder, reads custom primitive data, so no dynamic material is needed: \* On Light Mode Changed checks whether the On flag is set, writes 1 (on) or 0 (off) to the Blinder's custom primitive data at index 0, and hides the Blinder while the light is off. \* On Infrared Mode Changed writes 1 or 0 to the index from \`GetIsInfraredCustomPrimitiveIndex\` (5 by default, set in the \[developer settings\](/skgsfdocs/getting-started/developer-settings.md)), so an infrared light's Blinder only shows through night vision. !\[BP\\\_LightLaser setting the Blinder's custom primitive data and visibility when the light or infrared mode changes\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-26d5cb59cbe5f4fce8b6d75bb9f74bb14f01db74%2Flens-glow.png?alt=media) --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-light-and-laser.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skginfraredhandlercomponent.md). # SKGInfraredHandlerComponent This component is optional. It lets your own lights switch to infrared, so they only show through night vision, such as an IR illuminator. The lights in the timed courses on the example project use it. Lights using the \[SKGLightLaserComponent\](/skgsfdocs/components/skglightlasercomponent.md) already do this, so they don't need one. Night vision itself is covered in \[Setting up night vision\](/skgsfdocs/setup-guides/setting-up-night-vision.md). The component keeps track of whether the light is in infrared and sends it to every player. It doesn't change the light itself. You do that in your Blueprint when On Infrared Mode Changed fires. ## Setting up a light 1. Add an SKGInfraredHandler component to the actor with the light. 2. On BeginPlay, call \`SetupDynamicLightFunctionMaterial\` with M\\\_IRLightFunction from SKGSFCore/Materials/LightFunctions. 3. Bind On Infrared Mode Changed. When it's on, set the light's Light Function Material to \`GetLightFunctionMaterial\`. When it's off, set it to None. 4. If the light has a glowing mesh, such as a bulb, make it match the light. Give it a material that uses MF\\\_InfraredMask from SKGSFCore/Materials/Functions, such as M\\\_EmissiveMaster. In On Infrared Mode Changed, write 1 (infrared) or 0 to the mesh's custom primitive data at the index from \`GetIsInfraredCustomPrimitiveIndex\`, 5 by default. MF\\\_InfraredMask then only shows the mesh brightness through night vision while it's infrared. 5. Call \`SetInfraredMode\` to switch the light in or out of infrared. The example's BP\\\_LightBase, BP\\\_PointlightInfrared and BP\\\_Spotlight in TimedCourse/Lights are set up this way. !\[BP\\\_LightBase calls SetupDynamicLightFunctionMaterial on BeginPlay, with M\\\_IRLightFunction in a Light Function Parent Material variable\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-22374a520fecbdec87553fe90de7d11671a9cfec%2Fsetup-light-function.png?alt=media) !\[BP\\\_PointlightInfrared sets its Light Function Material to GetLightFunctionMaterial in infrared, and None out of it\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-a1403a7bc7c812f2af22bba012bd07682a3a6573%2Finfrared-mode-changed.png?alt=media) !\[BP\\\_LightBase writes 1 or 0 to its bulb's (Shape) custom primitive data at GetIsInfraredCustomPrimitiveIndex when infrared mode changes\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-5b7dfa7606795b5d97b93bd5a45a5434d0bf96a0%2Fbulb-material.png?alt=media) ## Functions ### Infrared \* \*\*SetInfraredMode\*\*: Switches in or out of infrared. Can be called on the client. The change is sent to the server and every player sees it. \* \*\*IsInfraredModeOn\*\*: True while in infrared. ### Light Function \* \*\*SetupDynamicLightFunctionMaterial\*\*: Makes a dynamic copy of the light function material you pass in and returns it. The copy is kept up to date with the night vision's mask, so the light only shows inside the night vision view. \* \*\*GetLightFunctionMaterial\*\*: The material made by SetupDynamicLightFunctionMaterial. ## Events \* \*\*On Infrared Mode Changed\*\*: When infrared turns on or off, on every player. Swap the light function here. \* \*\*On IRLight Mask Changed\*\*: When the night vision's mask changes, such as switching from a monocular to binoculars, with the new mask. The light function material is updated for you. --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skginfraredhandlercomponent.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/troubleshooting.md). # Troubleshooting Common problems and what to check. Many setup mistakes also log an error to the Output Log, so check it first. If you're still stuck, ask on the \[Discord\](https://discord.gg/W5g6pZXfjh). ## Setup \*\*Nothing works and the materials or anim layer are missing.\*\* SKGSFCore hasn't been migrated into your project. See \[Project Setup\](/skgsfdocs/getting-started/project-setup.md). \*\*Optics, night vision or thermal don't show up at all.\*\* Check that Custom Depth-Stencil Pass is set to Enabled with Stencil in Project Settings > Engine > Rendering, and that the SKGSF Material Parameter Collection is set to MPC\\\_SKGSF in \[Developer Settings\](/skgsfdocs/getting-started/developer-settings.md). Project settings aren't copied when you migrate content. ## Holding and aiming \*\*The firearm doesn't move with the procedural animation, or floats away from the hands.\*\* \* The skeleton needs ik\\\_hand\\\_gun, ik\\\_hand\\\_r, ik\\\_hand\\\_l (the mannequin already has these) and the three virtual bones. See \[Setting up a pawn\](/skgsfdocs/setup-guides/setting-up-a-pawn.md). \* The animation blueprint needs the SKGSFProcedurals layer, the Copy Bone from VB ik\\\_hand\\\_gun to ik\\\_hand\\\_gun to move the firearm and the hand IK to move the hands to the firearm. See \[Setting up the animation blueprint\](/skgsfdocs/setup-guides/setting-up-the-animation-blueprint.md). \* \`SetHeldActor\` has to be called on the server, and it doesn't attach the actor for you. Attach the firearm to the mesh at ik\\\_hand\\\_gun. \*\*Aiming doesn't line up with the sight.\*\* \* The S\\\_Aim socket should be in the middle of the sight window, where the eye looks through, with no rotation. See \[Setting up a red dot\](/skgsfdocs/setup-guides/setting-up-a-red-dot.md). \* If the socket is set up correctly but the firearm is rotated 90 degrees when aiming, Mesh Forward Axis in Project Settings > Plugins > SKG Shooter Framework doesn't match your meshes, such as X forward meshes with the setting on Y Forward. The framework uses this setting to know which way every firearm and attachment faces, so it has to match them. See \[Developer Settings\](/skgsfdocs/getting-started/developer-settings.md#procedural-animation). \* Aiming lines the sight up with the camera. When it starts, the SKGShooterPawn component finds the camera by its Camera Component Name and saves where it sits relative to the mesh's head bone. If it can't find the camera, it uses the Camera Attached Socket on the mesh instead, S\\\_Camera by default. If your camera moves relative to the head after that, such as from a head animation, turn on Constantly Update Camera Offset so the position is updated every frame. See \[SKGShooterPawnComponent\](/skgsfdocs/components/skgshooterpawncomponent.md). \*\*The firearm doesn't get pushed back by walls.\*\* Firearm collision needs an \[SKGMuzzleComponent\](/skgsfdocs/components/skgmuzzlecomponent.md) to know where the muzzle is, and the walls need to block the Firearm Collision Channel set in \[Developer Settings\](/skgsfdocs/getting-started/developer-settings.md). \*\*The offhand doesn't hold the handguard or grip.\*\* Check the S\\\_LeftHandIK socket, the Offhand IKMesh Name and the Offhand IKTag. See \[Setting up a handguard and forward grip\](/skgsfdocs/setup-guides/setting-up-a-handguard-and-forward-grip.md). If it only happens during a montage, its OffhandIKCurveAlpha curve is still at 1. See \[Performing animations\](/skgsfdocs/setup-guides/performing-animations.md). \*\*A pose doesn't play.\*\* A pose needs a Curve Tag, a To Curve and a From Curve, and has to be on the held item's SKGProceduralAnim component. If Pose Settings Data Assets has anything in it, it replaces Pose Settings. If other players don't see it, set the Third Person Curve. See \[Creating a custom pose\](/skgsfdocs/setup-guides/creating-a-custom-pose.md). ## Attachments \*\*An attachment won't go into a slot.\*\* \* With Use Legacy Attachment System on, the attachment has to be in one of the slot's Compatible Attachments, or the list has to be empty to accept all attachments. \* With gameplay tags, the attachment has to implement the gameplay tags interface, such as by being based on SKGBaseActor or your own c++ actor that implements it, and the slot's tag needs a row in a compatibility table. A slot whose tag has no row accepts nothing. See \[Gameplay tag attachment compatibility\](/skgsfdocs/setup-guides/gameplay-tag-attachment-compatibility.md). \* The Default Attachment has to pass the same check. ## Optics \*\*The magnified optic's lens is empty or only shows part of the image.\*\* \* The optic mesh needs S\\\_ObjectiveLens and the reticle mesh needs S\\\_RearLens. \* S\\\_RearLens has to sit right on the reticle plane's surface, within Lens Plane Depth Tolerance. \* The optic's Custom Depth Stencil Value can't be the night vision's Lens Stencil Value (25). See \[Setting up a magnified optic\](/skgsfdocs/setup-guides/setting-up-a-magnified-optic.md). \*\*A Normal mode optic doesn't zoom.\*\* Allow SKGCamera FOVChanges is likely off in \[Developer Settings\](/skgsfdocs/getting-started/developer-settings.md). \*\*Aiming a magnified optic hitches the first time.\*\* With the shared view family on, call \`WarmUpSharedView\` at a quiet moment, such as after equipping the weapon. See \[Shared view family\](/skgsfdocs/setup-guides/setting-up-a-magnified-optic.md#shared-view-family). \*\*In multiplayer PIE, one player's scope shows in another player's window.\*\* The shared view family doesn't support PIE with Run Under One Process. Turn that off or test in standalone. Packaged and standalone builds work. ## Night vision, infrared and thermal \*\*Night vision turns on but the image doesn't show.\*\* \* The two night vision materials have to be added as blendables on a Post Process component for the local player, with their weight set to 1 while the tubes are on. \* With the Mesh Visual Type, check Lens Mesh Name and Eyebox Center Locations. The lens doesn't get its stencil without them. \* If you changed Lens Stencil Value, change NightVisionStencilValue in MPC\\\_SKGSF to the same value. See \[Setting up night vision\](/skgsfdocs/setup-guides/setting-up-night-vision.md). \*\*Infrared lights and lasers don't show through night vision.\*\* \`EnableInfraredMode\` has to be called on the SKG Infrared World Subsystem for the local player when night vision turns on. The light or laser also needs Has Infrared Mode on and M\\\_IRLightFunction as its Infrared Light Function Material. See \[Setting up night vision\](/skgsfdocs/setup-guides/setting-up-night-vision.md) and \[Setting up a light and laser\](/skgsfdocs/setup-guides/setting-up-a-light-and-laser.md). \*\*The red dot is blinding through night vision.\*\* Turn on Supports Night Vision on the SKGOptic, add Reticle Night Vision Brightness Settings and call \`ToggleReticleNightVisionSetting\`. See \[Setting up a red dot\](/skgsfdocs/setup-guides/setting-up-a-red-dot.md). \*\*Hot objects don't show up in thermal optics.\*\* The mesh needs Render CustomDepth Pass on. For a body, check its component tag on the \[SKGObjectTemperatureComponent\](/skgsfdocs/components/skgobjecttemperaturecomponent.md). For a muzzle, turn on Auto Handle Muzzle Thermal Stencil Value on the \[SKGMuzzleComponent\](/skgsfdocs/components/skgmuzzlecomponent.md). Make sure the Temperature MPC is set in \[Developer Settings\](/skgsfdocs/getting-started/developer-settings.md). ## Other \*\*The laser goes through things, or stops on things it shouldn't.\*\* It stops at anything that blocks the Laser Collision Channel in \[Developer Settings\](/skgsfdocs/getting-started/developer-settings.md). --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/troubleshooting.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/updating-to-2-0-0.md). # Updating to 2.0.0 This page is only for projects that used the framework before 2.0.0. If you're starting fresh, follow \[Project Setup\](/skgsfdocs/getting-started/project-setup.md) instead. The tools below change and save your assets in place, and step 5 replaces SKGSFCore, so back up your project or commit it to version control first. If you changed anything inside SKGSFCore, copy it somewhere else first. ## 1. Update the plugin Replace the plugin in your project's Plugins folder with 2.0.0, then open your project. ## 2. Correct Data Assets From Previous Values Every project should run this once. In 2.0.0, every settings group can be set right on the component or come from a data asset, such as the optic's Initialization Settings with an Initialization Settings Data Asset field next to it. To make that work, each data asset now holds a single struct with all of its settings, instead of separate properties. See \[Data Assets\](/skgsfdocs/getting-started/data-assets.md). !\[The SKGOptic component's Initialization Settings, with the Initialization Settings Data Asset field above them\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-de3c397ff03459c7c817f315a3b52b7f5a781244%2Fsettings-struct.png?alt=media) Your data assets still have their old values saved. Run Tools > SKG Shooter Framework > Correct Data Assets From Previous Values to move them into the new structs so you don't lose them. It updates and saves every SKG data asset in the project that still has old values, then lists the ones it changed. Movement Lag Settings and Rotation Lag Settings data assets are always included, see Aim lag settings under Other changes. !\[The SKG Shooter Framework section in the Tools menu\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-e9b383432f88dd65a209b8f4edf61cc803e0488f%2Ftools-menu.png?alt=media) ## 3. Convert Y-Forward Settings to X-Forward Only run this if your project uses Y forward assets, and only run it once. Procedural values and curves now use the engine's axes no matter which way your meshes face. Location X is forward and back, Y is right and left, and Z is up and down. Rotation X is roll, Y is pitch, and Z is yaw. Before 2.0.0, Y forward projects had X and Y swapped. For example, a positive X on a recoil curve used to move the firearm right, and now it moves it forward, while a positive Y used to move it forward and now moves it right. Rotation lag and the other rotation settings now follow the engine's roll, pitch, and yaw too. Run Tools > SKG Shooter Framework > Convert Y-Forward Settings to X-Forward after step 2, since it converts the values step 2 moved into the structs. It converts your data assets and the curves they use, keeping your keys and tangents, and lists what it changed. \* \*\*Only run it once.\*\* Running it again converts everything again and breaks the values. \* Curves are changed in place, so anything else that uses the same curve sees the converted values too. \* Settings set directly on a component in a Blueprint, or in C++, aren't converted. Update those by hand if you need to. \* Combined rotations may need a small adjustment afterward. \* Your meshes aren't changed. Keep Mesh Forward Axis in \[Developer Settings\](/skgsfdocs/getting-started/developer-settings.md) on Y Forward. ## 4. Save all Use File > Save All so everything the tools changed is saved. ## 5. Replace SKGSFCore Some materials and other assets in SKGSFCore have moved or no longer exist in 2.0.0, so the old ones need to be removed instead of copied over. 1. Close your project and delete everything in its SKGSFCore folder in File Explorer. Deleting with the editor closed keeps your Blueprint references to these assets so they connect to the new ones with the same names. 2. Open the updated 2.0.0 example project, right-click its SKGSFCore folder in the Content Browser, pick Migrate and pick your project's Content folder. Make sure only items in the SKGSFCore folder are checked. 3. Open your project. Anything that still points to an asset that no longer exists shows up as a missing reference, so you can point it at its replacement. ## 6. Project settings 2.0.0 uses one material parameter collection, MPC\\\_SKGSF, instead of separate ones. In \[Developer Settings\](/skgsfdocs/getting-started/developer-settings.md), set SKGSF Material Parameter Collection on the SKG Shooter Framework page and Temperature Material Parameter Collection on the SKG Shooter Framework Temperature Settings page to MPC\\\_SKGSF. ## Other changes \* \*\*Mannequin and animations\*\*: The mannequin (SK\\\_Mannequin, SKM\\\_Manny and their materials and rigs), the locomotion animations, AS\\\_BasicRifleIdle and the grip poses moved from SKGSFCore to SKGSFExampleContent, in SKGSFExampleContent/Assets/Mannequin and SKGSFExampleContent/Animation/MannyAnimations. AnimBP\\\_SKGSF\\\_PlayerPawn is now AnimBP\\\_SKGSF\\\_PlayerPawn\\\_Template, a reference with no skeleton. If you used any of them, migrate them from the example project or use your own. The anim layers, such as AnimLayer\\\_SKGSF\\\_Procedurals, are templates now too, so you no longer assign your skeleton to them. See \[Setting up the animation blueprint\](/skgsfdocs/setup-guides/setting-up-the-animation-blueprint.md). \* \*\*Laser and muzzle temperature\*\*: The laser's color, brightness and infrared flag and the muzzle temperature are now written to the meshes' custom primitive data instead of dynamic materials, so Laser Material, Laser Dot Material, Muzzle Temp Material Parameter Name and \`RegisterDynamicMaterial\` are gone. Set the materials right on the laser, laser dot and muzzle mesh components, and remove any \`RegisterDynamicMaterial\` calls from your Blueprints as they no longer exist. If you made your own laser or heat up materials, read these values from custom primitive data at the Custom Primitive Index settings in \[Developer Settings\](/skgsfdocs/getting-started/developer-settings.md#custom-primitive-index). \* \*\*Attachment compatibility\*\*: To fix a typo (my bad) FSKGAttachmentSlotCompatbility was renamed to FSKGAttachmentSlotCompatibility and Slot Compatbility Override to Slot Compatibility Override. Your assets load with the new names automatically, but open and save your slot compatibility data tables once, or they won't show up in Slot Compatibility Table List. See \[Gameplay tag attachment compatibility\](/skgsfdocs/setup-guides/gameplay-tag-attachment-compatibility.md). \* \*\*Optic settings\*\*: Thermal Scene Capture GIMethod and Thermal Scene Capture Reflection Method are now Digital Scene Capture GIMethod and Digital Scene Capture Reflection Method. If you changed them, set them again in \[Developer Settings\](/skgsfdocs/getting-started/developer-settings.md). \* \*\*Aim lag settings\*\*: Movement Lag Settings and Rotation Lag Settings have new Aim Spring Interp Settings and Aim Interp Settings that blend in while aiming. See \[SKGProceduralAnimComponent\](/skgsfdocs/components/skgproceduralanimcomponent.md#movement-lag-settings). Correct Data Assets From Previous Values copies your Spring Interp Settings and Interp Settings into them every time it runs, so aiming feels the same as before. Set your aim values after you run it. Settings set directly on a component aren't copied, so copy those by hand. --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/getting-started/updating-to-2-0-0.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmattachmentstatcomponent.md). # SKGFirearmAttachmentStatComponent This component is optional. It gives an attachment stats, such as a suppressor adding weight and cutting recoil. Add one to each attachment actor that should change the firearm's stats. When the attachment is added, the \[SKGFirearmComponent\](/skgsfdocs/components/skgfirearmcomponent.md) applies its stats on top of the firearm's Firearm Stat Settings, and takes them back off when the attachment is removed. The framework doesn't use the stats itself. Read the totals with \`GetFirearmStats\` on the SKGFirearmComponent for your own gameplay and UI, such as a stats screen. To change how the stats are applied, override \`AddFirearmAttachmentStats\` and \`RemoveFirearmAttachmentStats\` in a Blueprint child of the SKGFirearmComponent. Set everything on the component and leave the Data Asset field empty. Using data assets as templates is covered in \[Data Assets\](/skgsfdocs/getting-started/data-assets.md). ## Settings !\[The SKGFirearmAttachmentStat component's settings, all at their defaults\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-275d399119034763ff9402390e1da92c8188937c%2Fdetails-panel.png?alt=media) ### Initialize \* \*\*Attachment Stats Data Asset\*\*: Leave empty and use Attachment Stats. \* \*\*Gameplay Tags\*\*: Tags you can use to identify this component in your own logic. #### Attachment Stats \* \*\*Weight\*\* / \*\*Ergonomics\*\*: Added to the firearm's. Use a negative value to lower them. \* \*\*Accuracy\*\*: Added to the firearm's accuracy in MOA. Lower is more accurate, so -0.5 tightens the spread. \* \*\*Vertical Recoil\*\* / \*\*Horizontal Recoil\*\*: Percent change to the firearm's recoil. -20 cuts it by 20%. Each attachment's change multiplies the last, so two -20 attachments leave 64% of the recoil, not 60%. \* \*\*Muzzle Velocity Percentage\*\*: Percent change to muzzle velocity, such as a longer barrel adding 10. \* \*\*Fire Rate Change Percent\*\*: Percent change to the firearm's fire rate in rounds per minute. 10 fires 10% faster. ## Functions ### Stats \* \*\*GetAttachmentStats\*\*: The stats from the data asset if one is set, otherwise Attachment Stats. \* \*\*SetAttachmentStats\*\*: Replaces the stats and clears the data asset. A firearm the attachment is already on updates its totals. Call on the server. ### Other \* \*\*GetFirearmAttachmentStatComponent\*\*: Returns the SKGFirearmAttachmentStatComponent on an actor. --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmattachmentstatcomponent.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent.md). # SKGShooterPawnComponent Connects your pawn to the rest of the framework. Add one to every pawn that holds items, such as your player character. It finds the pawn's meshes and camera by name, links the procedural anim layer, and keeps track of the held actor. Aiming, leaning, free look, poses and recoil all go through it. Call \`SetHeldActor\` on the server when the player equips something, such as a firearm. See \[Setting up a pawn\](/skgsfdocs/setup-guides/setting-up-a-pawn.md) for the full pawn setup. !\[BP\\\_PlayerPawn's components. The SKGShooterPawn component finds Mesh (CharacterMesh0) and Camera by name\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-267610a4288f2e6f37d3ce59d72be0a60be81394%2Fcomponents.png?alt=media) ## Settings ### Initialize !\[The SKGShooterPawn component's Initialize settings on BP\\\_PlayerPawn\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-71aef927935f638703cf34686768d44e29208623%2Finitialize.png?alt=media) \* \*\*Using Legacy Input Scales\*\*: Match this to Enable Legacy Input Scales in Project Settings > Input, so free look knows which way is up. It's on in the example project. \* \*\*Linked Anim Layer Class\*\*: The anim layer that runs the procedural animation, a child of SKGShooterFrameworkAnimInstance such as AnimLayer\\\_SKGSF\\\_Procedurals. See \[Setting up the animation blueprint\](/skgsfdocs/setup-guides/setting-up-the-animation-blueprint.md). Leave empty if you link it yourself with \`LinkAnimLayerClass\` or \`LinkAnimLayerClassByInstance\`, like the example's BP\\\_PlayerPawn does. \* \*\*Auto Setup Linked Anim Layer\*\*: Links the Linked Anim Layer Class on BeginPlay. With no class set, it uses the mesh's own anim BP instead, which must then be a child of SKGShooterFrameworkAnimInstance. Off in the example. \* \*\*Use Single Mesh\*\*: Uses one mesh for both first and third person, such as true first person. Only one of the two mesh names needs to match. On in the example, with both mesh names set to CharacterMesh0. \* \*\*Third Person Mesh Component Name\*\* / \*\*First Person Mesh Component Name\*\*: Names of the pawn's skeletal meshes. A Character's mesh is CharacterMesh0. The local player uses the first person mesh and other players see the third person mesh. If a mesh isn't found, the game crashes on BeginPlay with a message naming the setting. \* \*\*Camera Component Name\*\*: Name of the pawn's Camera or Gameplay Camera component. Aiming lines up the sight with the camera using its position relative to the mesh's head bone, so the mesh needs a bone named head. The camera's field of view on BeginPlay is the one aiming zooms in from. \* \*\*Camera Attached Socket\*\*: The camera socket on the head, S\\\_Camera in the example. Used to line up aiming when no camera is found. \* \*\*Constantly Update Camera Offset\*\*: Updates the camera's position relative to the head every frame, such as when head animations move the camera. Leave off if the camera doesn't move. In the example, the camera is attached to S\\\_Camera and follows the head without animation. \* \*\*Replicate Remote Yaw\*\*: Sends the player's look yaw to other players. Unreal only sends the pitch, so this is needed for free look and turn in place to show on other players' screens. If you don't need free look and have another solution (or do not want) for turn in place, disable this. \* \*\*Remote Yaw Replication Rate\*\*: Seconds between yaw updates. 0 sends it every frame. 0.033333 in the example, about 30 times a second. \* \*\*Gameplay Tags\*\*: Tags you can use to identify this component in your own logic. ### FreeLook Free look lets the player look around without turning the body or the firearm, such as while holding Alt. !\[BP\\\_PlayerPawn's FreeLook and Leaning settings\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-997c0e332f055460e38cd06942e988ad54e638d3%2Ffree-look-leaning.png?alt=media) #### Free Look Settings \* \*\*Auto Set Use Controller Rotation Yaw\*\*: Turns off the pawn's Use Controller Rotation Yaw while free looking so the body doesn't turn, and turns it back on after. \* \*\*Max Pitch Up\*\* / \*\*Max Pitch Down\*\* / \*\*Max Yaw Left\*\* / \*\*Max Yaw Right\*\*: How far in degrees the player can look from where free look started. ### Leaning Leaning tilts the spine left and right with \`Lean\`. #### Lean Left Right Settings \* \*\*Use Spring Interp\*\*: Uses a spring for the lean, so it can overshoot and settle. Off uses Interp Speed. \* \*\*Stiffness\*\* / \*\*Critical Damping Factor\*\* / \*\*Mass\*\* / \*\*Target Velocity Amount\*\*: The spring's settings. Higher Stiffness leans faster, and a lower Critical Damping Factor bounces more. \* \*\*Interp Speed\*\*: How fast the lean moves when Use Spring Interp is off. \* \*\*Max Lean Angle\*\*: The lean in degrees at full lean, 35 in the example. Up to 90. ### Debug Shown in the SKGShooter Framework section, above the component's other settings. Editor only, for firearm collision. !\[The Debug settings\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-c31160415082ebe41eaeec2a9dccf86981e064ac%2Fdebug.png?alt=media) \* \*\*Print Hit\*\*: Logs what firearm collision hits to the Output Log. \* \*\*Draw Debug Trace\*\*: Draws the firearm collision trace in red. ## Functions Aiming, leaning, free look, poses and switching hands is predicted and called on the client. The change is sent to the server and every player sees it. ### Held Actor \* \*\*SetHeldActor\*\*: Call on the server when the player equips something, such as a firearm. It replicates to every player. A firearm is driven by its \[SKGFirearmComponent\](/skgsfdocs/components/skgfirearmcomponent.md). Anything else uses its own \[SKGProceduralAnimComponent\](/skgsfdocs/components/skgproceduralanimcomponent.md) and \[SKGOffhandIKComponent\](/skgsfdocs/components/skgoffhandikcomponent.md). \* \*\*ClearHeldActor\*\*: Call on the server when the player drops or puts away the held actor. With nothing held, an \[SKGProceduralAnimComponent\](/skgsfdocs/components/skgproceduralanimcomponent.md) on the pawn itself is used, such as for fists. \* \*\*GetHeldActor\*\*: The actor being held. ### Aiming \* \*\*StartAiming\*\* / \*\*StopAiming\*\*: Starts or stops aiming with the held actor. StartAiming does nothing if the held actor's Can Aim is off. \* \*\*StartAimingAI\*\* / \*\*StopAimingAI\*\*: For AI pawns on the server. Sets aiming without the optic or Can Aim checks. Calls on a client do nothing. \* \*\*IsAiming\*\*: True while aiming. \* \*\*GetAimPercentage\*\*: How far into aiming the animation is, from 0 (not aiming) to 1 (fully aimed). ### Free Look \* \*\*StartFreeLook\*\* / \*\*StopFreeLook\*\*: Starts or stops free look. StopFreeLook turns the view back to where free look started. \* \*\*IsFreeLooking\*\*: True while free looking. \* \*\*SetMouseInput\*\*: Pass your look input here each time you get it. Free look uses it for its limits, and deadzone uses it to move the firearm. \* \*\*CanAddYaw\*\* / \*\*CanAddPitch\*\*: False once free look reaches a limit in that direction. Don't add look input in that direction while it's false. ### Leaning \* \*\*Lean\*\*: Leans toward a target from -1 to 1, as a fraction of Max Lean Angle. 0 stands back up and 0.5 leans halfway. \* \*\*GetTargetLeanAngle\*\*: The angle in degrees being leaned toward. \* \*\*GetCurrentLeanAngle\*\*: The angle the animation is at right now. ### Procedural Animation \* \*\*PerformProceduralRecoil\*\*: Plays recoil from the \[SKGProceduralAnimComponent\](/skgsfdocs/components/skgproceduralanimcomponent.md)'s Recoil Settings. Only plays on the machine that calls it so you will want to call this on replication locally for remote clients. The multipliers scale the control rotation, location and rotation recoil, such as less recoil while crouched. \* \*\*PerformProceduralPose\*\*: Plays a pose from the held item's Pose Settings by its Curve Tag, such as high ready, low ready, short stock, etc. With Exit Pose on, it plays the pose's From Curve to go back to normal. See \[Creating a custom pose\](/skgsfdocs/setup-guides/creating-a-custom-pose.md). \* \*\*PerformCustomCurve\*\*: Plays a one-off curve, such as a bump when walking into a wall. Its Replication Settings choose whether other players see it. \* \*\*GetProceduralPoseData\*\*: Returns a pose's curves by its Curve Tag. \* \*\*GetCurrentProceduralPoseReplicationData\*\*: The last pose played and whether it was the exit. \* \*\*SetSwayMultiplier\*\*: Replaces the sway multiplier, such as higher while injured or lower such as 0.25f while holding breath. Only changes it on the local machine. \* \*\*ResetSwayMultiplier\*\*: Goes back to the sway settings' own multiplier. \* \*\*GetUsingCustomSwayMultiplier\*\*: True after SetSwayMultiplier until ResetSwayMultiplier. \* \*\*SetUseFirstPersonProceduralsAsLocal\*\* / \*\*SetUseThirdPersonProceduralsAsLocal\*\*: Which procedural settings the local player uses. First person is the default. Switch to third person for a third person camera. \* \*\*IsUsingFirstPersonProceduralsAsLocal\*\*: True if the local player uses the first person settings. \* \*\*IsThirdPerson\*\*: True for other players, or when the local player uses the third person settings. ### Hands Right-handed is the default, with the offhand on the left. \* \*\*SetOffhandIKToRightHand\*\*: Switches to left-handed mode with the offhand being the right hand. Only works if the firearm's Can Use Left Hand Dominate is on. \* \*\*SetOffhandIKToLeftHand\*\*: Switches back to right-handed. \* \*\*GetOffhandIKIsLeftHand\*\*: True when right-handed. ### Firearm Collision Firearm collision pushes the firearm back when it's close to a wall. Its settings are on the \[SKGFirearmComponent\](/skgsfdocs/components/skgfirearmcomponent.md). \* \*\*GetFirearmCollisionPushAmount\*\*: How far firearm collision is pushing the firearm back. 0 when nothing is in the way. \* \*\*EnableFirearmCollisionDisableOverride\*\* / \*\*ClearFirearmCollisionDisableOverride\*\*: Turns firearm collision off, or back to the firearm's setting, such as during a cutscene. \* \*\*GetFirearmCollisionDisableOverride\*\*: True while firearm collision is turned off this way. ### Camera While aiming, the component zooms the Camera component's field of view by the \[SKGProceduralAnimComponent\](/skgsfdocs/components/skgproceduralanimcomponent.md)'s Camera Zoom Percentage, or to the optic's magnification in Normal mode. This can be turned off in the Camera section of \[Developer Settings\](/skgsfdocs/getting-started/developer-settings.md). \* \*\*SetCameraDefaultFOV\*\*: Sets the field of view aiming zooms in from. Call it when the player changes their field of view setting. \* \*\*GetDesiredCameraFOV\*\*: The field of view the camera is moving toward, for your own camera system. ### Optics and Sensitivity Magnified Optic Mode and Monitor Distance Coefficient are stored per player in the SKGShooterLocalPlayerSubsystem, but aren't saved, so set them from your settings menu and save them in your game user settings. \* \*\*SetMagnifiedOpticMode\*\* / \*\*GetMagnifiedOpticMode\*\*: Picture in Picture or Normal (traditional camera zoom) for magnified optics. See \[SKGOpticComponent\](/skgsfdocs/components/skgopticcomponent.md). \* \*\*SetMonitorDistanceCoefficient\*\* / \*\*GetMonitorDistanceCoefficient\*\*: How much aim sensitivity drops as you zoom in. 0 divides it by the zoom, so a 4x scope gets a quarter. Higher values lower it less. 1.33 by default. \* \*\*GetMagnificationSensitivityMultiplier\*\*: Multiply your look input by this while aiming so sensitivity matches the zoom. Includes the optic's Sensitivity Scale. \* \*\*GetSensitivityMultiplier\*\*: Takes your look input and turn rates and returns the new X and Y, and whether to add yaw and pitch. Applies GetMagnificationSensitivityMultiplier while aiming and stops at the free look limits. \* \*\*BP\\\_GetMagnificationSensitivityMultiplier\*\* / \*\*BP\\\_GetSensitivityMultiplier\*\*: Same as GetMagnificationSensitivityMultiplier and GetSensitivityMultiplier, but you can override them in a Blueprint child of this component. ### Animation Layer \* \*\*LinkAnimLayerClass\*\*: Links an anim layer class to the pawn's meshes and returns it. Use it when Auto Setup Linked Anim Layer is off, or to switch layers, such as a different layer while unarmed. \* \*\*LinkAnimLayerClassByInstance\*\*: Same as LinkAnimLayerClass, but links it to the anim instance you pass in. \* \*\*UnlinkAnimLayerClass\*\* / \*\*UnlinkAnimLayerClassByInstance\*\*: Unlinks the current anim layer. \* \*\*GetShooterFrameworkAnimInstance\*\*: The linked procedural anim layer. ### Components \* \*\*GetCurrentFirearmComponent\*\*: The held firearm's \[SKGFirearmComponent\](/skgsfdocs/components/skgfirearmcomponent.md). \* \*\*GetCurrentProceduralAnimComponent\*\*: The \[SKGProceduralAnimComponent\](/skgsfdocs/components/skgproceduralanimcomponent.md) being aimed with, such as the firearm's current optic. \* \*\*GetCurrentOpticComponent\*\*: The current \[SKGOpticComponent\](/skgsfdocs/components/skgopticcomponent.md). \* \*\*GetCurrentLightLaserComponents\*\*: The held actor's \[SKGLightLaserComponents\](/skgsfdocs/components/skglightlasercomponent.md). Empty if it has none. ### Setup \* \*\*SetupComponents\*\*: Finds the meshes and camera by name. Called for you on BeginPlay. Call it again if you swap them later. \* \*\*SetCameraOffset\*\*: Saves the camera's position relative to the head. Called by SetupComponents, and every frame with Constantly Update Camera Offset. \* \*\*RefreshLocalPlayerSettings\*\*: Reloads Magnified Optic Mode and Monitor Distance Coefficient from the player. Called for you on BeginPlay, possession and respawn. \* \*\*GetProceduralData\*\*: Builds the data the anim layer uses. The anim layer calls it every frame, so you don't need to. ### Getters \* \*\*GetPawnMesh\*\*: The first person mesh for the local player, the third person mesh for other players. \* \*\*GetFirstPersonMesh\*\* / \*\*GetThirdPersonMesh\*\*: The meshes found from the names in Initialize. \* \*\*GetCameraComponent\*\* / \*\*GetGameplayCameraComponent\*\*: The camera found from Camera Component Name. \* \*\*GetCameraAttachedSocket\*\*: Returns Camera Attached Socket. \* \*\*GetOwningPawn\*\*: The pawn this component is on. \* \*\*GetProceduralShooterPawnData\*\*: Data for your anim graph: the held item's Procedural Anim Gameplay Tag, whether it's right-handed, where free look is looking, and whether anything is held. \* \*\*IsLocallyControlled\*\*: True for the local player's pawn. \* \*\*GetControlRotation\*\*: The pawn's control rotation, including on other players' machines, where it uses the replicated pitch and yaw. ### Other \* \*\*GetShooterPawnComponent\*\*: Returns the SKGShooterPawnComponent on an actor. ## Events \* \*\*On Held Actor Set\*\*: When the held actor changes, with the new and old actor. Fires for every player. \* \*\*On Aim State Changed\*\*: When aiming starts or stops. \* \*\*On Free Look State Changed\*\*: When free look starts or stops. \* \*\*On Offhand IKIs Left Hand Changed\*\*: When switching between right- and left-handed. \* \*\*On Pose Complete\*\*: When a pose finishes, with its tag and whether it was the exit. \* \*\*On Firearm Collision Changed\*\*: When firearm collision starts or stops pushing the firearm back. \* \*\*On Anim Instance Ticked\*\*: At the end of every anim layer update, with the delta time. --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgshooterpawncomponent.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-attachments.md). # Setting up attachments An attachment is any actor that goes into a slot on the firearm or on another attachment such as a barrel, handguard, stock, or optic. The example's M4 is built this way: its receiver has slots for the barrel, handguard, stock, pistol grip, charging handle and optic, and the handguard has its own rail slots. The attachment system is optional. If you use your own (common when using inventory systems), call \`AddAttachment\` and \`RemoveAttachment\` on the \[SKGFirearmComponent\](/skgsfdocs/components/skgfirearmcomponent.md) whenever an attachment is added or removed, and skip this guide. Set up the firearm first, as covered in \[Setting up a firearm\](/skgsfdocs/setup-guides/setting-up-a-firearm.md). ## 1. Add the manager to the firearm Add an SKGAttachmentManager component to the firearm, then set the SKGFirearm component's Attachment Manager Component Name to its name. The firearm now finds every attachment for you, including ones on other attachments. See \[SKGAttachmentManagerComponent\](/skgsfdocs/components/skgattachmentmanagercomponent.md). !\[The SKGFirearm component pointing to the SKGAttachmentManager\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-95b787182b1554f244b34d9394628fd549647c66%2Ffirearm-manager-name.png?alt=media) ## 2. Add a slot Every slot setting used below such as the rail's snap distance and how far an attachment can move is explained on the \[SKGAttachmentComponent\](/skgsfdocs/components/skgattachmentcomponent.md) page. Do this for each place an attachment can go: 1. Add a socket to the mesh where the attachment goes, such as S\\\_Attachment\\\_Barrel. This is where the attachment will be placed. 2. Add an SKGAttachment component and name it after the slot, such as SKGAttachment\\\_Barrel. Set Attach to Mesh Name to the mesh it will be attaching to (such as FirearmMeshComponent for the barrel in the example) and Attach to Socket to the socket (such as S\\\_Attachment\\\_Barrel for the barrel in the example). 3. Set Default Attachment to the attachment it starts with, such as BP\\\_M4\\\_Barrel. Turn on Is Required to Function for parts the firearm can't work without if you wish to have a system built around this (think disabling a firearm from shooting if you do not have a barrel). 4. Pick which attachments fit, under Compatibility. Leave Use Legacy Attachment System on, which is the default. The gameplay tag system is covered in \[Gameplay tag attachment compatibility\](/skgsfdocs/setup-guides/gameplay-tag-attachment-compatibility.md). Make a data asset with SKG > Data Assets > Attachment > Attachment Compatibility Settings, list the attachments that fit, and add it to Compatible Attachments. Leave Compatible Attachments empty to allow any attachment. 5. For a rail that the attachment can slide along, such as an optic rail, leave Use Offset System on and set the rail's snap distance and how far it can move. Turn it off for slots that don't move, such as a barrel. !\[The S\\\_Attachment\\\_Optic socket on the M4\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-026c5ad2ce42a3ac2829ddac6ae94c2b38d6c567%2Fattach-to-socket.png?alt=media) !\[The M4's optic slot\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-a8af6492cebee2bd1e1a77543e12afce66487d40%2Fdetails-panel.png?alt=media) !\[A compatibility data asset listing the optics that fit the M4\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-662ec4b5693a4acea63d25cebb6aeaef599a62a7%2Fcompatible-attachments.png?alt=media) ## 3. Make an attachment 1. Create an Actor Blueprint and turn on Replicates for multiplayer. The slot spawns the attachment on the server, and it replicates to everyone. 2. Add its mesh. 3. Add the SKG components it needs. A handguard gets an \[SKGOffhandIKComponent\](/skgsfdocs/components/skgoffhandikcomponent.md) for the hand, and a barrel gets an \[SKGMuzzleComponent\](/skgsfdocs/components/skgmuzzlecomponent.md). The optic, grip, and muzzle guides cover theirs. 4. Add slots of its own if things attach to it the same way as step 2. For reference, the handguard has top and bottom rails and the barrel has a muzzle slot. They register with the firearm's manager on their own. !\[BP\\\_M4\\\_Handguard's components: its mesh, the top and bottom rail slots, and SKGOffHandIK for the hand\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-367fd94845920da7fad24ef518932b02b2ae36f9%2Fhandguard-components.png?alt=media) !\[BP\\\_M4\\\_Barrel's components: its mesh, the SKGAttachment\\\_Muzzle slot for a muzzle device, and SKGMuzzle\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-e9d4aa5e0a44a58d445e13ac52f0cdcd7ef5e90d%2Fbarrel-components.png?alt=media) --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-attachments.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgmuzzlecomponent.md). # SKGMuzzleComponent This component is optional. It marks where the muzzle is: where bullets leave from and where firearm collision is checked to. Without it, firearm collision won't work and you'll need your own way to find where bullets leave from. It also has an optional muzzle temperature system for a glowing hot suppressor or a hot muzzle in thermal optics. Add one to the firearm and to every attachment that can be the end of the barrel, such as a barrel, muzzle device or suppressor, if you wish to use it. See \[Setting up a muzzle device\](/skgsfdocs/setup-guides/setting-up-a-muzzle-device.md) for a step by step setup. The \[SKGFirearmComponent\](/skgsfdocs/components/skgfirearmcomponent.md) picks which one is used by its Muzzle Tag: a suppressor first, then a muzzle device, then the barrel. Add a suppressor and the bullets leave from the end of the suppressor. Set everything on the component and leave the Data Asset fields empty. Using data assets as templates is covered in \[Data Assets\](/skgsfdocs/getting-started/data-assets.md). ## Settings !\[BP\\\_MuzzleDevice\\\_Suppressor's SKGMuzzle settings, tagged as a suppressor with the temperature system on\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-2772496dce699c46b0fa90b296f21154103c648b%2Fdetails-panel.png?alt=media) ### Initialize \* \*\*Auto Initialize\*\*: Sets up the component when it's created. If you turn this off, call \`InitializeMuzzleComponent\` yourself. \* \*\*Override Component Names\*\*: Only for setting the mesh and socket names from C++. Leave off. \* \*\*Initialization Settings Data Asset\*\*: Leave empty and use Initialization Settings. #### Initialization Settings \* \*\*Muzzle Mesh Component Name\*\*: Name of the mesh component that has the muzzle socket, such as the barrel or suppressor mesh. \* \*\*Muzzle Socket Name\*\*: The socket at the end of the muzzle. Its X axis (red arrow) must point out of the barrel, the direction the bullet travels. !\[The S\\\_Muzzle socket just past the end of the suppressor, with the red X arrow pointing out of the barrel\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-5d6932b459307038dd2849ade651a806b281344b%2Fmuzzle-socket.png?alt=media) ### Settings \* \*\*Muzzle Settings Data Asset\*\*: Leave empty and use Muzzle Settings. \* \*\*Gameplay Tags\*\*: Tags you can use to identify this component in your own logic. #### Muzzle Settings \* \*\*Muzzle Tag\*\*: Barrel, Muzzle Device or Suppressor. Decides which muzzle is used when there's more than one. A firearm with a built-in barrel uses Barrel. Muzzle temperature. The temperature is written to the muzzle mesh's custom primitive data every time it changes at Muzzle Temp Custom Primitive Index in \[Developer Settings\](/skgsfdocs/getting-started/developer-settings.md), 0 for M\\\_HeatUp\\\_Master. \* \*\*Use Muzzle Temperature System\*\*: Heats the muzzle with each shot and cools it over time. \* \*\*Muzzle Temp Curve\*\*: Turns built-up heat (time) into a temperature (value), in Celsius. Each shot moves along the curve and cooling moves back. The first key's value must be 0, since cooling stops when the temperature reaches 0. The last key is the hottest the muzzle can get. The example curve goes from 0 at 25 to 800 at 100, so with Increase Muzzle Temperature Amount at 2 the first 12 shots don't heat it up and it reaches 800 after 50. \* \*\*Increase Muzzle Temperature Amount\*\*: How far along the curve each shot moves. \* \*\*Decrease Muzzle Temperature Amount Per Tick\*\*: How far back along the curve it moves each second while cooling. \* \*\*Use Kelvin for Muzzle Temperature\*\*: Writes the temperature in Kelvin instead of Celsius. \* \*\*Auto Handle Muzzle Thermal Stencil Value\*\*: Sets the muzzle mesh's custom depth stencil from 100 when cold to 255 at the hottest, so thermal optics show it heating up. Turn on Render CustomDepth Pass on the mesh. !\[C\\\_MuzzleTemp\\\_Suppressor, rising from 0 at 25 to 800 at 100\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-0cd60634b52781d341271478a7f1c56f523abf1f%2Ftemperature-curve.png?alt=media) ## Functions ### Initialize \* \*\*InitializeMuzzleComponent\*\*: Sets up the component from its settings. Called for you when Auto Initialize is on. \* \*\*InitializeMuzzleComponentFromSettings\*\*: Sets up the component from the settings you pass in. ### Transform Most of the time use the versions on the \[SKGFirearmComponent\](/skgsfdocs/components/skgfirearmcomponent.md), which pick the current muzzle for you. The projectile functions return a location and direction, which is smaller to send to the server than a full transform. \* \*\*GetMuzzleTransform\*\*: World transform of the muzzle socket. \* \*\*GetMuzzleProjectileTransform\*\*: Where to spawn the bullet and which way to send it. Adds a random spread of up to the specified MOA. \* \*\*GetMuzzleProjectileTransformCompensated\*\*: Same as GetMuzzleProjectileTransform, but angled so the shot crosses where the Aim Transform points at Zero Distance Meters. It ignores bullet drop, so it's a rough zero. ### Muzzle Temperature \* \*\*ShotPerformed\*\*: Heats the muzzle by one shot. The SKGFirearmComponent's \`ShotPerformed\` calls this for you. \* \*\*SetMuzzleTemperature\*\*: Sets the temperature directly. \* \*\*GetMuzzleTemperatureCelsius\*\* / \*\*GetMuzzleTemperatureFahrenheit\*\* / \*\*GetMuzzleTemperatureKelvin\*\*: The current temperature. \* \*\*GetMuzzleTemperatureNormalized\*\*: The current temperature from 0 (cold) to 1 (the curve's hottest). \* \*\*IsUsingMuzzleTemperatureSystem\*\*: Returns Use Muzzle Temperature System. ### Getters \* \*\*GetMuzzleTag\*\*: Returns the Muzzle Tag. \* \*\*GetMuzzleMesh\*\*: The mesh from Muzzle Mesh Component Name. ### Other \* \*\*GetMuzzleComponent\*\*: Returns the SKGMuzzleComponent on an actor. ## Events \* \*\*On Muzzle Temperature Changed\*\*: Each time the temperature changes, with the new temperature. Only on the machine that called ShotPerformed. \* \*\*On Muzzle Cooled\*\*: When the muzzle has fully cooled. --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgmuzzlecomponent.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-night-vision.md). # Setting up night vision This guide sets up helmet mounted night vision like the example's dual tube goggles BP\\\_NightVision. It uses the \[SKGNightVisionComponent\](/skgsfdocs/components/skgnightvisioncomponent.md). ## How it works The night vision image is two post process materials, PPM\\\_NightVision and PPM\\\_NVScintillation, on a Post Process component in the goggles. They're only added for the player wearing them. With the Mesh Visual Type, the image only shows through the lens mesh. The component puts a custom stencil on the lens and the post process only draws where it is, so you see night vision through the tubes and normal vision around them like real goggles. Overlay uses a texture mask on the screen instead, and Fullscreen covers the whole screen. Neither needs a lens mesh. The component handles the materials, gain, tube burn-in and the illuminator. Turning the goggles on and off and showing the image is done in your Blueprint. ## 1. Meshes The example's goggles are two meshes in SKGSFCore/NightVision/DualTube: \* SM\\\_NVG\\\_DualTube\\\_Housing, the body. \* SM\\\_NVG\\\_DualTube\\\_Lens, the glass in front of each tube, with MI\\\_NVG\\\_DualTube (made from M\\\_GlassWithEyebox). The lens needs to be its own mesh so only it gets the stencil. Add a socket on the lens mesh at the center of each tube, S\\\_EyeboxLeft and S\\\_EyeboxRight in the example. Use one for a monocular such as a PVS-14, or four for panoramic such as GPNVGs. The component sends their positions to the lens material so each tube gets its own eyebox. !\[The S\\\_EyeboxLeft and S\\\_EyeboxRight sockets on SM\\\_NVG\\\_DualTube\\\_Lens\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-88ca026808dcdfdba24289c75351d98b8535f557%2Flens-sockets.png?alt=media) ## 2. Night vision Blueprint Create an Actor Blueprint and turn on Replicates. Add these components: \* The housing mesh (Housing in the example), with the lens mesh (Tube) attached to it. \* A \*\*Spot Light\*\* attached to the housing with the component tag Illuminator, for an infrared illuminator. Optional. \* A \*\*Post Process\*\* component (PP\\\_NightVision). Leave Infinite Extent (Unbound) on. \* An \*\*SKGNightVision\*\* component. !\[BP\\\_NightVision's components: the Tube lens and the SpotLight illuminator under the Housing mesh, PP\\\_NightVision and SKGNightVision\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-c4936c64610b52f0f6ac690681ac3ff4c302769b%2Fcomponents.png?alt=media) ### SKGNightVision Every setting is explained on the \[SKGNightVisionComponent\](/skgsfdocs/components/skgnightvisioncomponent.md) page. These are the ones to set. Under Tube Settings: \* Set Night Vision Material to PPM\\\_NightVision and Night Vision Scintillation Material to PPM\\\_NVScintillation from SKGSFCore/Materials/PostProcess/NightVision. \* Pick a Color, such as green or white phosphor, and set Gain and Max Gain. \* Burn in Render Target Size makes bright lights streak and burn into the tubes, 1024 in the example. It renders an extra pass every frame while the tubes are on, so set it to 0 if you don't want burn-in. \* IRLight Mask Render Target Size keeps infrared light inside the lens, 512 in the example. !\[BP\\\_NightVision's Tube Settings\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-992bd9ca4865f25e0d3120d6cdb1092bc0fa68e9%2Ftube-settings.png?alt=media) Under Housing Settings: \* Leave Visual Type on Mesh. \* Set Lens Mesh Name to the lens mesh, Tube in the example. \* Add the lens sockets to Eyebox Center Locations, left first. \* Leave Lens Stencil Value at 25. If something else in your project already uses 25, change it here and change NightVisionStencilValue in MPC\\\_SKGSF (SKGSFCore/Materials) to the same value. \* Turn on Manual Gain so the player can change the gain, and set Gain Adjustment Step Amount. \* For the illuminator, set Illuminator Light Component Tag to Illuminator, Infrared Light Function Material to M\\\_IRLightFunction, and add the brightness levels to Illuminator Brightness Settings. !\[BP\\\_NightVision's Housing Settings\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-7fd6fbb03f01fb0abd64b0abd7ec0ae10ef913f0%2Fhousing-settings.png?alt=media) The component turns on Render CustomDepth Pass on the lens mesh and sets its CustomDepth Stencil Value to Lens Stencil Value for you. It's the same as setting them on the mesh yourself, like on the example's Tube. !\[The Tube lens mesh with Render CustomDepth Pass on and a CustomDepth Stencil Value of 25\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-fce826c33b6416ee68fbdd1a14b24ebba729c532%2Flens-stencil.png?alt=media) ## 3. Showing the image On Begin Play, BP\\\_NightVision checks that its owner is the local player. Then it calls \`CreateAndSetupDynamicNightVisionMaterialInstance\` and adds both materials it returns to PP\\\_NightVision as blendables with a weight of 0. This is only done for the local player because the Post Process component is unbound, so another player's goggles would otherwise put night vision on your screen. !\[BP\\\_NightVision adds both night vision materials to its PP Night Vision component with a weight of 0, only for the local player\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-a2325c1a531bf7b268a12eaa03d60665e98d18e7%2Fblendables.png?alt=media) Bind On Tubes On State Changed on the \[SKGNightVision\](/skgsfdocs/components/skgnightvisioncomponent.md) component. When the tubes turn on, set both blendables to a weight of 1, and back to 0 when they turn off. !\[BP\\\_NightVision setting the blendables' weight when the tubes turn on and off\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-9d886741131348f416c053c0629bce13cb75c5c1%2Ftubes-on-state-changed.png?alt=media) ## 4. Flipping up and down The example's BP\\\_NightVision has FlipDown and FlipUp events. FlipDown calls \`TurnTubesOn\` and FlipUp calls \`TurnTubesOff\`. Both rotate the housing at Nods Flip Speed, FlipUp to Nods Up Rotation, and send bNodsDown to the server so other players see the goggles flip. !\[BP\\\_NightVision's FlipDown and FlipUp events turning the tubes on and off and sending the nods state to the server\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-c60d1dd297f8776e9f3419980b86cd3a478a3fca%2Fflip-events.png?alt=media) ## 5. Pawn The example's BP\\\_PlayerPawn spawns BP\\\_NightVision on the server on Begin Play with the pawn as its Owner and attaches it to NightVisionAttach which is a scene component on the pawn. The Owner has to be the pawn, both for the local player check in step 3 and so the client can call the flip's server event. Then it binds the inputs: \* IA\\\_NightVision flips the goggles down and calls \`EnableInfraredMode\` on the SKG Infrared World Subsystem, then flips them up and calls \`DisableInfraredMode\` the next time. \* IA\\\_NightVision\\\_IncreaseGain and IA\\\_NightVision\\\_DecreaseGain call \`IncreaseGain\` and \`DecreaseGain\` on the SKGNightVision component. \`EnableInfraredMode\` tells everything else that this player is using night vision. Lights and lasers in infrared mode, such as an \[SKGLightLaserComponent\](/skgsfdocs/components/skglightlasercomponent.md), only show while it's on, and magnified optics show the night vision image through the tubes. Call it on the local player only. !\[BP\\\_PlayerPawn's IA\\\_NightVision flipping the goggles down with Enable Infrared Mode, and up with Disable Infrared Mode\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-a1623b524b4beaf29e2cb86a81834de4c8ab80dd%2Fpawn-inputs.png?alt=media) The illuminator is turned on and off with \`TurnIlluminatorOn\` and \`TurnIlluminatorOff\`, and \`CycleIlluminatorBrightness\` steps through its brightness levels. These can be called on the client and every player sees the change. ## Optics Magnified optics work through night vision without extra setup. Don't set an optic's Custom Depth Stencil Value to the Lens Stencil Value (25). Night Vision Light Transmission on the \[SKGOpticComponent\](/skgsfdocs/components/skgopticcomponent.md) sets how much light the scope lets through while night vision is on. For red dots, turn on Supports Night Vision on the SKGOptic and add Reticle Night Vision Brightness Settings, then call \`ToggleReticleNightVisionSetting\` so the reticle isn't blinding through the tubes. --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-night-vision.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-the-animation-blueprint.md). # Setting up the animation blueprint The procedural animation (aiming, sway, lag, recoil, poses, firearm collision and so on) runs in an anim layer the plugin provides, AnimLayer\\\_SKGSF\\\_Procedurals in /All/Game/SKGSFCore/Animation/Layers/Procedural. You don't build or copy it. It's a template animation blueprint with no skeleton, so it works with your skeleton as is. Your own animation blueprint plays your animations, runs that layer on the upper body, and finishes with hand IK. AnimBP\\\_SKGSF\\\_PlayerPawn\\\_Template in SKGSFCore/Animation is set up this way. It's only there as a reference, which is why it's a template with no skeleton and doesn't depend on the mannequin. It comes into your project with SKGSFCore, as covered in \[Project Setup\](/skgsfdocs/getting-started/project-setup.md), so you can open it, read its node settings, and copy and paste from it. You can also make a child of it for your skeleton if you want, like the example's AnimBP\\\_SKGSF\\\_PlayerPawn\\\_Manny in SKGSFExampleContent/Animation, which uses SK\\\_Mannequin and swaps in the example's locomotion animations. Set up the skeleton first, as covered in \[Setting up a pawn\](/skgsfdocs/setup-guides/setting-up-a-pawn.md). The layer needs its virtual bones. ## 1. Add the procedural layer to your animation blueprint 1. Open your animation blueprint, click Class Settings, and under Implemented Interfaces add ALI\\\_SKGSFExample. It's in /All/Game/SKGSFCore/Animation/Layers. !\[Class Settings > Interfaces > Implemented Interfaces with ALI SKGSFExample added\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-86493986f811729990d762dc4c9750619ca248b8%2Fimplemented-interfaces.png?alt=media) 2. The SKGSFProcedurals layer now shows under Animation Layers in My Blueprint. Drag it into the AnimGraph. !\[SKGSFProcedurals under Animation Layers. SKGSFUpperBody is the example's own way of doing upper body animations, and isn't needed.\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-9c539563659b4d3b3942f37d7c41ea152c05b0d2%2Finterface.png?alt=media) ## 2. Build the AnimGraph This is a simplified setup to get you started. Your AnimGraph doesn't have to look like this as the system is more flexible than shown here. Build it around your own animation needs such as adding your own layers, blends, or state machines. The one thing to keep is splitting the upper and lower body before the Copy Bone. The quickest start is to copy these nodes from AnimBP\\\_SKGSF\\\_PlayerPawn\\\_Template and paste them into your AnimGraph, or make a child of it and swap in your locomotion animations. A simple setup, in order: 1. \*\*Your upper body pose\*\*, such as an idle holding a rifle, then a \*\*Slot\*\* node so montages such as reloads play, into the \*\*SKGSFProcedurals\*\* layer. See \[Performing animations\](/skgsfdocs/setup-guides/performing-animations.md) for montages. 2. \*\*Layered blend per bone\*\*, so locomotion drives the legs and the procedural animation drives the upper body. Set Blend Mode to Blend Mask and add the upper body mask from your skeleton to Blend Masks, such as UpperBodyLowerBodySplitMask. Turn on Mesh Space Rotation Blend. Plug your locomotion into Base Pose and the SKGSFProcedurals layer into Blend Poses 0. Do this split before the Copy Bone, or the blend mask causes problems with ik\\\_hand\\\_gun. The template has no skeleton, so it has no blend masks to pick from and its Blend Masks entry is left at None. Instead, its Layered blend per bone runs SetUpperBodyBlendMask as its On Initial Update function, which calls Set Blend Mask with Pose Index 0 and the name UpperBodyLowerBodySplitMask. Set Blend Mask finds the mask by that name on whatever skeleton is playing. That was the only way to keep it a template and remove its dependency on the mannequin. In your own animation blueprint, just pick your skeleton's mask in Blend Masks. If you make a child of the template, name your skeleton's blend mask UpperBodyLowerBodySplitMask so it's found. !\[The template's Layered blend per bone, with Locomotion in Base Pose, the procedural layer's output in Blend Poses 0, Blend Masks at None and SetUpperBodyBlendMask as On Initial Update\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-00a7b59112058631f0488568a2887da88bea14fa%2Flayered-blend.png?alt=media) !\[SetUpperBodyBlendMask converts the node to a Layered Bone Blend and calls Set Blend Mask with UpperBodyLowerBodySplitMask on pose 0\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-1bb9987d3c1f14841b220dfad1f0edd079037cfd%2Fset-blend-mask.png?alt=media) 3. \*\*Copy Bone\*\* from VB ik\\\_hand\\\_gun to ik\\\_hand\\\_gun, with Copy Translation and Copy Rotation on. This moves the held item to where the procedural animation put it. 4. \*\*Two Bone IK\*\* for each hand, so the hands follow the item: \* IK Bone hand\\\_r, Effector Target ik\\\_hand\\\_r, Joint Target upperarm\\\_r. \* IK Bone hand\\\_l, Effector Target ik\\\_hand\\\_l, Joint Target upperarm\\\_l. \* On both, set Effector Location Space and Joint Target Location Space to Bone Space, and turn on Take Rotation from Effector Space. 5. Optional: a \*\*Look At\*\* on the head, to turn the head toward where the player looks while free looking. The example uses the Free Look Look At Location from \`GetProceduralShooterPawnData\` on the SKGShooterPawn component. 6. \*\*Output Pose\*\*. Unreal adds the Local To Component and Component To Local nodes between them for you. Turn the Copy Bone and Two Bone IK nodes off while nothing is held, so they don't move the hands when there's nothing to hold. The example sets their Alpha Input Type to Bool Value and plugs a Has Held Actor value into Enabled. You can get it from \`GetProceduralShooterPawnData\`. !\[AnimBP\\\_SKGSF\\\_PlayerPawn\\\_Template's AnimGraph\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-f16aa72b3d731b593766c58f98fd923aad3ebbde%2Fanim-graph.png?alt=media) The Joint Target Location sets which way the elbows point. The example's values are good starting points: (X=-165.0, Y=160.0, Z=25.0) for hand\\\_r and (X=165.0, Y=-160.0, Z=25.0) for hand\\\_l. !\[The hand\\\_r and hand\\\_l Two Bone IK settings\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-16f5f55affdc48c57350170f362b827bc048ca9e%2Ftwo-bone-ik.png?alt=media) ## 3. Link the layer The SKGSFProcedurals layer doesn't run until AnimLayer\\\_SKGSF\\\_Procedurals is linked to it. Either: \* \*\*Automatically\*\*: On the pawn's \[SKGShooterPawn component\](/skgsfdocs/components/skgshooterpawncomponent.md), set Linked Anim Layer Class to AnimLayer\\\_SKGSF\\\_Procedurals and turn on Auto Setup Linked Anim Layer. It links on BeginPlay. \* \*\*Yourself\*\*: Call \`LinkAnimLayerClass\` or \`LinkAnimLayerClassByInstance\` on the SKGShooterPawn component, such as to switch layers while playing. The example's BP\\\_PlayerPawn binds the SKGShooterPawn component's \[On Held Actor Set\](/skgsfdocs/components/skgshooterpawncomponent.md#events) in SetupAnimationLinking. Its HeldActorChanged event then calls UnlinkHeldActor with the old actor and LinkHeldActor with the new one, which call \`LinkAnimLayerClass\`. For example, when a held actor is set such as a firearm being equipped (assuming you were holding nothing before), it unlinks the unarmed layer AnimLayer\\\_SKGSF\\\_Procedurals\\\_Unarmed and links the full procedural layer AnimLayer\\\_SKGSF\\\_Procedurals. When you drop that firearm, it unlinks the full procedural layer AnimLayer\\\_SKGSF\\\_Procedurals and links the unarmed layer AnimLayer\\\_SKGSF\\\_Procedurals\\\_Unarmed. !\[BP\\\_PlayerPawn binds On Held Actor Set, then UnlinkHeldActor and LinkHeldActor swap the layers. The Link Anim Class Layers nodes are for the example's own upper body layers.\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-6761fbae52ac65088f25f37add8c71f008ce4732%2Flink-layer.png?alt=media) Then set your pawn mesh's Anim Class to your animation blueprint, as in \[Setting up a pawn\](/skgsfdocs/setup-guides/setting-up-a-pawn.md). --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-the-animation-blueprint.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/physical-materials.md). # Physical Materials SKGPhysicalMaterial is optional. Nothing else in the framework needs it, so skip this page if you already have your own impact or footstep system as this is mostly a helper. It's a Physical Material that also holds effects to play when something hits that surface, such as footsteps or bullet impacts. Each effect has a gameplay tag and can play a Niagara effect, place a decal, and play a sound. A wood floor and a metal floor can then play different footstep sounds from the same animation. The example uses it for footsteps on its floor. ## 1. Make the physical material In the Content Browser, right-click and pick Physics > Physical Material, then pick SKGPhysicalMaterial as the class. The example's is PM\\\_Floor in SKGSFExampleContent/Materials/PhysicalMaterials. Add an element to Effects for each kind of hit the surface reacts to: \* \*\*Tag\*\*: Which effect this is, such as Impact.Footstep. It has to match the tag you play exactly. Impact.Footstep is the example's tag, in the DT\\\_Impacts data table in SKGSFExampleContent/Data/DataTables/GameplayTags. \* \*\*Impact Visual Settings\*\*: \* \*\*Impact Effect\*\*: A Niagara system spawned at the hit. \* \*\*Impact Decal\*\*: A decal material placed on the surface, such as a bullet hole. \* \*\*Use Particles Rotation\*\*: Off rotates the effect and decal to face out of the surface. On keeps the effect's own rotation, which also stops the decal lining up with the surface, so leave it off when using a decal. \* \*\*Decal Size\*\* / \*\*Decal Life Time\*\* / \*\*Decal Fade Screen Size\*\*: How big the decal is, how many seconds it stays, and how small on screen it gets before it fades out. \* \*\*Impact Sound Settings\*\*: The \*\*Sound\*\* to play at the hit, with a \*\*Volume Multiplier\*\* and \*\*Pitch Multiplier\*\*. The physical material also has: \* \*\*Speed Of Sound Tolerance\*\*: When an effect is played with speed of sound, the sound is delayed by how long it takes to reach the player, such as a distant bullet impact being heard after it's seen. Delays shorter than this play right away. 0.2 seconds by default. \* \*\*Gameplay Tags\*\*: Tags you can use to identify this surface in your own logic. !\[PM\\\_Floor with an Impact.Footstep effect that plays SC\\\_FootstepsWood\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-f4a8e7e15ef64d9ce918cda987930ecd43b89683%2Fpm-floor.png?alt=media) ## 2. Use it on a surface It can go in three places: \* \*\*Phys Material\*\* on a material, like the example's M\\\_PrototypeGrid with PM\\\_Floor. Every surface using that material gets it. \* \*\*Phys Material\*\* on a material instance, to give one instance a different surface than its parent. \* \*\*Phys Material Override\*\* on a mesh or collision component, which wins over the material's. !\[M\\\_PrototypeGrid with PM\\\_Floor as its Phys Material\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-de2b36483405faeed0fb8c040456f34e3b7222c9%2Fmaterial-phys-material.png?alt=media) ## 3. Footsteps Add the USKGPlayFootstepSound anim notify to your locomotion animations where each foot lands. It traces 100 cm straight down from the foot and plays the matching effect if the surface has an SKGPhysicalMaterial. \* \*\*Foot Bone Name\*\*: The foot the trace starts from, such as foot\\\_l or foot\\\_r. \* \*\*Physical Material Effect Tag\*\*: The effect to play, such as Impact.Footstep. \* \*\*Trace Channel\*\*: The channel the trace uses. Visibility by default. The example's locomotion animations in SKGSFExampleContent/Animation/MannyAnimations/Locomotion already have these notifies with Impact.Footstep. For your own animations, use your own gameplay tag, or migrate DT\\\_Impacts and add it to Gameplay Tag Table List in Project Settings > Gameplay Tags. !\[MM\\\_Unarmed\\\_Walk\\\_Fwd's USKGPlayFootstepSound notifies, with one on foot\\\_r using Impact.Footstep\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-fe87e80b5c17496e4629b773a9a105a744e02370%2Ffootstep-notify.png?alt=media) ## 4. Bullet impacts and other hits For anything else, call \`PlayEffect\` on the SKGPhysicalMaterial with the hit result and the effect tag. Get the physical material from the hit's Phys Mat and cast it to SKGPhysicalMaterial. Turn on Use Speed Of Sound for hits the player might be far from, such as bullet impacts. The \[projectile system\](/skgsfdocs/systems/projectiles.md) returns the physical material in its hits, so On Impact is a good place to play bullet impacts. ## Functions \* \*\*PlayEffect\*\*: Plays the effect with the given tag at the hit. With Use Speed Of Sound on, the sound is delayed by the distance to the local player. \* \*\*GetEffect\*\*: Finds the effect with the given tag. Returns true if found. \* \*\*GetEffects\*\*: Every effect on this physical material. --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/physical-materials.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/performing-animations.md). # Performing animations Animations such as reloads are played as montages on the character's mesh with the procedural animation running on top of them. This guide uses the example's M4 reload: AM\\\_Character\\\_M4\\\_Reload on the character and AM\\\_M4\\\_Reload on the M4. ## How montages fit in In AnimBP\\\_SKGSF\\\_PlayerPawn\\\_Template, the upper body pose goes into a Slot node (DefaultSlot), then into the SKGSFProcedurals layer. Because the slot comes before the procedural layer, aiming, sway, recoil, poses and looking up and down are all applied on top of the montage. The firearm still aims and follows where you look while reloading. This is a simplified setup to get you started. Your AnimGraph doesn't have to look like this as the system is more flexible than shown here, such as using your own slots, slot groups or blends for different animations. Build it around your own animation needs. Montages that use DefaultSlot need no changes to the example's AnimBP. To use your own slot, the simplest place for it is the same spot, between your upper body pose and the SKGSFProcedurals layer. !\[The upper body pose going through the DefaultSlot Slot node into the SKGSFProcedurals layer\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-46956e709c333260e2d9672226361ccf6c56d2c9%2Fanim-graph-slot.png?alt=media) ## 1. Additive or not The example's montages are additive: the reload plays on top of the current upper body pose instead of replacing it, so one reload works from whatever idle the firearm uses. A non additive montage replaces the upper body pose while it plays, which also works with the slot above. If you're unfamiliar with additive animations, Unreal's documentation on them is worth a read. To make an animation additive, open the animation sequence, not the montage, such as AS\\\_Character\\\_M4\\\_Reload. Under Additive Settings: \* Set Additive Anim Type to Mesh Space. \* Set Base Pose Type to Frame from this animation and Ref Frame Index to 0, so the first frame of the reload is the pose everything else is added to. You can instead use Selected animation frame with your idle animation at frame 0. For a non additive animation, leave Additive Anim Type on No additive. !\[AS\\\_Character\\\_M4\\\_Reload's Additive Settings: Mesh Space, Frame from this animation, Ref Frame Index 0\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-684a68b737b89a01752538d47625c3a0fd570b8b%2Fadditive-settings.png?alt=media) An additive montage looks broken in the montage editor, since it's previewed on its own A pose. In the montage's Asset Details under Additive Settings, set Preview Base Pose to your idle, AS\\\_BasicRifleIdle in the example. This is only for previewing the montage in the editor. It has no effect on how the montage plays in game. !\[AM\\\_Character\\\_M4\\\_Reload with AS\\\_BasicRifleIdle as its Preview Base Pose, used only for the editor preview\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-8ddd5c10ce3b224f3a8152d04585fc2f59a85843%2Fpreview-base-pose.png?alt=media) ## 2. Curves The framework reads two curves from the animations playing on the character. Add them to the montage's curves, like on AM\\\_Character\\\_M4\\\_Reload: \* \*\*OffhandIKCurveAlpha\*\*: Turns the offhand IK off, so the animation's own hand can let go of the firearm, such as to grab a magazine. 1 is off, 0 holds the handguard or grip as normal. The example's reload goes to 1 at the start and back to 0 at the end. \* \*\*AimCurveAlpha\*\*: How much of the montage's firearm rotation still shows while aiming. 0 keeps the sights locked on target, higher lets the animation tilt the firearm while aiming. The example's reload uses 0.1 in the middle, so a little of the reload shows while aiming. The curve names can be changed with Offhand IKCurve Name and Aim Curve Name in your AnimBP's Class Defaults. !\[AM\\\_Character\\\_M4\\\_Reload's AimCurveAlpha (top), peaking around 0.1, and OffhandIKCurveAlpha (bottom), at 1 for most of the reload\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-aaa6651ecda8f6fa8ab95f023f9a8f4e425e3475%2Fmontage-curves.png?alt=media) ## 3. Play the montage Play the character's montage on the pawn's mesh, and the firearm's own montage on the firearm's mesh if it has one. The example's BP\\\_Firearm does this in PerformReload with its ReloadMontageSet, which holds a Pawn montage and an Item montage. It gets its owner as a Character and plays the Pawn montage on its Mesh, then plays the Item montage on the Firearm Mesh Component. When the firearm's montage completes, it sets Is Reloading back to false. !\[BP\\\_Firearm's PerformReload playing the Pawn montage on the character's Mesh and the Item montage on the Firearm Mesh Component\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-7949553e7f55cb7efe170a038968477d251407d1%2Fplay-reload.png?alt=media) --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/performing-animations.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/creating-a-custom-pose.md). # Creating a custom pose A pose moves the held item to a new position and rotation and back again, such as high port, low port, short stock, blind fire, sprint, etc. Poses are made from curves instead of animations, so the M4 and the bolt action in the example share the same ones. This guide uses the example's high port pose, DA\\\_Pose\\\_HighPort, as the example. ## How a pose works Every pose has a gameplay tag. Call \`PerformProceduralPose\` on the \[SKGShooterPawnComponent\](/skgsfdocs/components/skgshooterpawncomponent.md) with that tag, and the pose with that tag on the held item's \[SKGProceduralAnimComponent\](/skgsfdocs/components/skgproceduralanimcomponent.md) plays. A pose has two sets of curves: \* The \*\*To Curve\*\* goes into the pose, such as from idle to high port. The firearm stays at the end of the To Curve until you leave the pose. \* The \*\*From Curve\*\* goes from the pose back to idle. Each has a First Person Curve and a Third Person Curve, so a pose can look right in both. The Third Person Curve plays in third person and on other players' screens. ## 1. Gameplay tag Make a tag for the pose, such as Poses.HighPort. The example keeps its pose tags in the DT\\\_Poses data table in SKGSFExampleContent/Data/DataTables/GameplayTags: Poses.HighPort, Poses.LowPort, Poses.ShortStock and Poses.Sprint. To make your own table, create a Data Table with the GameplayTagTableRow structure, then add it to Gameplay Tag Table List in Project Settings > Gameplay Tags. You can also add the tag in Project Settings like any other tag. !\[DT\\\_Poses with the example's four pose tags\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-1dd4126ebc7c5956a1dc1c39c8bf738424d6325b%2Fdt-poses.png?alt=media) ## 2. Find the values The example has a pose customization widget for finding where the firearm should end up. Press Play, hold the firearm and press G. Type a location and rotation into the boxes and the firearm moves there. Load Current Pose fills the boxes with where the firearm is now, so you can play a pose and press it to see that pose's values. \* Location is in cm. X is forward and back, Y is right and left, Z is up and down. \* Rotation is in degrees. X is roll, Y is pitch, Z is yaw. The curves use the same axes, so the numbers go straight into them. They're the same for X forward and Y forward firearms. Firearm Collision switches the boxes to the pose used when the firearm is pushed back by a wall. The high port ends at a location of -8.75, 3.75, -17.5 and a rotation of -2.5, 30, 0, which pulls the firearm back and down and pitches it up 30 degrees. The widget is the example's WBP\\\_PoseCustomization. It calls \`SetTestPose\` and \`GetCurrentPoseValues\` on the anim instance, so you can migrate it to your project and use it there. !\[The pose customization widget after pressing Load Current Pose in high port\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-668242c9a3ad18745a9ab535657a21a71961a0c4%2Fpose-customization.png?alt=media) ## 3. To Curve Right-click in the Content Browser and pick Miscellaneous > Curve > CurveVector. Make one for location and one for rotation. The example's are C\\\_Pose\\\_Sample\\\_HighPort\\\_Location and C\\\_Pose\\\_Sample\\\_HighPort\\\_Rotation in SKGSFCore/SampleCurves/Poses. In each curve, key X, Y and Z at time 0 with a value of 0, then key them again at the end with the values from the widget. Right-click the keys and pick Cubic (Auto) so the firearm eases in and out instead of moving in a straight line, then add keys in between to shape it, such as the high port's X pushing forward before pulling back. Opening the example's curves is the quickest way to see a finished one. The curve's time is multiplied by the Play Rate you set in step 5. The high port curves end at 6 with a Play Rate of 12, so they take half a second. The curve ends at its last key on any of its X, Y and Z channels. !\[C\\\_Pose\\\_Sample\\\_HighPort\\\_Location, ending at -8.75, 3.75 and -17.5 at 6\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-52d9940dcd34ac16cd9aea2e7a866eb4d4b01c69%2Flocation-curve.png?alt=media) ## 4. From Curve Duplicate both curves and add \\\_Return to the names. Reverse them so they start at the To Curve's end values at time 0 and end at 0. They must end at 0, or the firearm stays offset after leaving the pose. !\[C\\\_Pose\\\_Sample\\\_HighPort\\\_Location\\\_Return, going from the high port values back to 0\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-7fe671a75cc972b7a61e09a6b89f29ea23539c60%2Flocation-return-curve.png?alt=media) ## 5. Pose settings Right-click in the Content Browser and pick SKG > Data Assets > ProceduralAnim > Procedural Pose Settings. The example's poses are in SKGSFExampleContent/Data/ProceduralSettings/Poses. \* Set Curve Tag to your tag. \* Under To Curve, set the First Person Curve's Location Curve and Rotation Curve to your two curves, and its Play Rate. Set the Third Person Curve too, otherwise other players won't see the pose. The same curves work if you don't need different ones. \* Under From Curve, do the same with the \\\_Return curves. \* Optional: turn on Interpolate to blend toward the curve instead of following it exactly, at Interpolation Speed. This smooths switching poses partway through. The pose is ignored unless it has a Curve Tag, a To Curve and a From Curve. Every setting is explained on the \[SKGProceduralAnimComponent\](/skgsfdocs/components/skgproceduralanimcomponent.md#pose-settings) page. !\[DA\\\_Pose\\\_HighPort's settings, with a Play Rate of 12 and Interpolate on\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-4078e8c8ddda09776e62668aae42c000edeccd31%2Fpose-data-asset.png?alt=media) ## 6. Add it to the firearm Select the firearm's \[SKGProceduralAnim\](/skgsfdocs/components/skgproceduralanimcomponent.md) component and add the data asset to Pose Settings Data Assets. The M4 and the bolt action both have DA\\\_Pose\\\_HighPort, DA\\\_Pose\\\_LowPort, DA\\\_Pose\\\_ShortStock and DA\\\_Pose\\\_Sprinting. For a held item that isn't a firearm, add it to that item's SKGProceduralAnim component. You can add the pose straight to Pose Settings on the component instead, but don't use both. If Pose Settings Data Assets has anything in it, it replaces Pose Settings. !\[BP\\\_M4's SKGProceduralAnim component with its four pose data assets\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-5de35ebe2469651567ec0db4485fd923f1e99fc0%2Ffirearm-poses.png?alt=media) ## 7. Play the pose Call \`PerformProceduralPose\` on the \[SKGShooterPawnComponent\](/skgsfdocs/components/skgshooterpawncomponent.md) with the tag. With Exit Pose off it plays the To Curve, and with it on it plays the From Curve. Call it on the client. It's sent to the server and every player sees it. On Pose Complete fires when a curve finishes. The example's BP\\\_PlayerPawn plays high port on mouse wheel up, low port on mouse wheel down and short stock on middle mouse. Each key checks \`CanPerformPose\`, which makes sure you aren't sprinting, and that you aren't aiming, since the mouse wheel zooms while aiming. Then it calls the TryGoToPose event. If you're in a pose, TryGoToPose plays that pose's exit, otherwise it goes into the key's pose, so pressing the key again goes back to idle. Sprinting plays Poses.Sprint. To test a new pose quickly, swap the tag on one of the keys for yours. !\[BP\\\_PlayerPawn's TryGoToPose event and the middle mouse, mouse wheel up and mouse wheel down keys that call it\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-739c757a3a219628fcb0d066f3c08ea24fdc1f55%2Fpawn-pose-inputs.png?alt=media) ## Left-handed Make the curves for right-handed. When the firearm is held left-handed, the Y location, roll and yaw are mirrored for you. --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/creating-a-custom-pose.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgcharactermovementcomponent.md). # SKGCharacterMovementComponent This component is optional. It's a Character Movement component with sprinting built in. Sprinting is predicted, so it works in multiplayer without the player snapping back. It only works on a Character. Other pawns, such as ones using the General Movement Component or Mover, handle sprinting themselves. To use it, open your Character Blueprint, select the Character Movement component, and set Component Class in the Variable section to SKGCharacterMovementComponent. !\[BP\\\_PlayerPawn's Character Movement component, with Component Class set to SKGCharacterMovementComponent\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-dbbe1f88b6b519ae023a64fc65fb37aba43d7f05%2Fcomponent-class.png?alt=media) It also changes a few of Character Movement's defaults: Max Walk Speed 150, Max Walk Speed Crouched 75, Max Acceleration 1365 and Braking Friction 1. ## Settings ### Sprint !\[BP\\\_PlayerPawn's Sprint settings\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-6045d44053fa6ba1fe4eccccb01f8da4b7578665%2Fsprint-settings.png?alt=media) \* \*\*Max Sprint Speed\*\*: Speed in cm/s while sprinting, 350 in the example. \* \*\*Sprint Angle Tolerance\*\*: How close to forward the player must move to sprint, from -1 to 1. The default 0.25 allows up to about 75 degrees off forward. Higher is stricter. \* \*\*Only Allow Forward Sprint\*\*: Only sprints while moving forward within Sprint Angle Tolerance. Off lets the player sprint in any direction. ## Functions ### Sprint \* \*\*StartSprinting\*\* / \*\*StopSprinting\*\*: Starts or stops sprinting. Call them on the player's own machine, such as from input. The movement is sent to the server for you. \* \*\*GetWantsToSprint\*\*: True between StartSprinting and StopSprinting, even if the player isn't sprinting yet. \* \*\*AreSprintingConditionsMet\*\*: True while the player is actually sprinting. Crouching stops the sprint until the player stands. \* \*\*IsVelocityWithinSprintAngleTolerance\*\*: True if the player is moving forward within Sprint Angle Tolerance. --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgcharactermovementcomponent.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent.md). # SKGFirearmComponent The attachment components are optional. If you use your own attachment system, call \`AddAttachment\` and \`RemoveAttachment\` on this component whenever an attachment is added or removed. The core of every firearm. Add one to each firearm Blueprint. It finds the SKG components on the firearm and its attachments, such as aiming devices, offhand grips, muzzles, lights and lasers, and picks the one in use, such as which optic you aim through or which muzzle the bullet leaves from. The \[SKGShooterPawnComponent\](/skgsfdocs/components/skgshooterpawncomponent.md) reads everything it needs from here. See \[Setting up a firearm\](/skgsfdocs/setup-guides/setting-up-a-firearm.md) for a step by step setup. Set everything on the component in your firearm Blueprint and leave the Data Asset fields empty. Using data assets as templates is covered in \[Data Assets\](/skgsfdocs/getting-started/data-assets.md). ## Settings !\[BP\\\_BoltGun's SKGFirearm Initialize settings\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-52b36377d352ff2af2dfcf86fc8399939499bbc7%2Fdetails-panel.png?alt=media) ### Initialize \* \*\*Auto Initialize\*\*: Sets up the firearm on Begin Play. If you turn this off, call \`InitializeFirearmComponent\` yourself. \* \*\*Firearm Mesh Component Name\*\*: Name of the firearm's mesh component, static or skeletal. The game crashes on Begin Play if no mesh has this name. \* \*\*Attachment Manager Component Name\*\*: Name of the \[SKGAttachmentManagerComponent\](/skgsfdocs/components/skgattachmentmanagercomponent.md), if you use one. The firearm then adds and removes attachments for you. Leave as None if you are using your own attachment system. \* \*\*Firearm Stats Data Asset\*\*: Leave empty and use Firearm Stat Settings. \* \*\*Firearm Stat Settings\*\*: The firearm's base stats: Weight, Durability, Ergonomics, Accuracy (in MOA), Vertical Recoil, Horizontal Recoil and Fire Rate (rounds per minute). Attachments with an \[SKGFirearmAttachmentStatComponent\](/skgsfdocs/components/skgfirearmattachmentstatcomponent.md) change them. The framework doesn't use these values itself. Read them with \`GetFirearmStats\` for your own gameplay and UI. \* \*\*Gameplay Tags\*\*: Tags you can use to identify this firearm in your own logic. ### FirearmCollision Pulls the firearm back when the barrel runs into a wall. A sphere trace runs down the barrel, and the further it's pushed back, the further the firearm moves along the pose curves. Turn on Draw Debug Trace on the \[SKGShooterPawnComponent\](/skgsfdocs/components/skgshooterpawncomponent.md) to see the trace. !\[BP\\\_BoltGun's firearm collision settings, using the sample curves\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-14b29d48a4493b8a525b753f6bb96f7455b3c00d%2Ffirearm-collision.png?alt=media) \* \*\*Firearm Collision Settings Data Asset\*\*: Leave empty and use Firearm Collision Settings. #### Firearm Collision Settings \* \*\*Use Firearm Collision\*\*: Turns firearm collision on. \* \*\*Trace Diameter\*\*: Diameter of the trace, in cm. \* \*\*Stop Aiming Distance\*\*: How far the barrel can be pushed back while aiming before aiming stops, relative to the trace length. \* \*\*Resume Aiming Distance\*\*: Aiming can start again once the push drops below this. Keep it lower than Stop Aiming Distance, or aiming flickers on and off against a wall. \* \*\*Pose Location Curve\*\* / \*\*Pose Rotation Curve\*\*: How the firearm moves as it's pushed back. Location is X forward, Y right, Z up. Rotation is X roll, Y pitch, Z yaw, in degrees. The sample curves pull into a short stock, then point the muzzle down. \* \*\*Pose Scale\*\*: How fast the firearm moves through the curves. The curves are read at the push distance in cm times Pose Scale. \* \*\*Pose Location Interp Speed\*\* / \*\*Pose Rotation Interp Speed\*\*: How quickly the firearm moves to the new pose. ## Functions ### SKG Firearm \* \*\*InitializeFirearmComponent\*\*: Sets up the firearm from its settings. Called on Begin Play when Auto Initialize is on. \* \*\*InitializeFirearmComponentFromSettings\*\*: Sets up the firearm from the settings you pass in. \* \*\*GetFirearmMeshComponent\*\*: The mesh from Firearm Mesh Component Name. ### Attachments Call these on the server. \* \*\*AddAttachment\*\* / \*\*RemoveAttachment\*\*: Tells the firearm an attachment was added or removed, along with everything attached to it. Only needed with your own attachment system. \* \*\*OnStockOffsetChanged\*\*: Passes a stock's rail offset to its \[SKGStockComponent\](/skgsfdocs/components/skgstockcomponent.md) to change the length of pull. Done for you when the stock is in an SKGAttachmentComponent. ### Aim \* \*\*CycleAimingDevice\*\*: Switches to the next aiming device that can aim, such as from a scope to an offset red dot. Is Aiming tells the new optic to start its scope image right away if it is using picture in picture. \* \*\*SetAimingDevice\*\*: Switches to a specific aiming device, either the firearm's own or one on an attachment. \* \*\*StartPointAiming\*\* / \*\*StopPointAiming\*\*: Aims with the point aim socket set on the firearm's \[SKGProceduralAnimComponent\](/skgsfdocs/components/skgproceduralanimcomponent.md), such as a canted aim. Right Hand Dominant picks the right- or left-handed socket. Is Aiming tells the previous optic to start its scope image again. \* \*\*IsPointAiming\*\*: True while point aiming. \* \*\*GetAimSocketWorldTransform\*\*: World transform of the current aiming device's aim socket. \* \*\*GetMagnifiers\*\*: Every optic on the firearm with Is Magnifier on. ### Muzzle The current muzzle is picked by its muzzle tag: a suppressor first, then a muzzle device, then the barrel. \* \*\*ShotPerformed\*\*: Call every time the firearm fires. Passes the shot to every \[SKGMuzzleComponent\](/skgsfdocs/components/skgmuzzlecomponent.md) for muzzle temperature. \* \*\*GetMuzzleProjectileTransform\*\*: Where to spawn the bullet and which way to send it. Adds a random spread of up to the specified MOA. While aiming a magnified optic in Normal mode, it also applies that optic's zero. \* \*\*GetMuzzleProjectileTransforms\*\*: Same as GetMuzzleProjectileTransform, but for several projectiles at once such as shotgun pellets. Each gets its own spread. \* \*\*GetMuzzleTransform\*\*: World transform of the current muzzle. \* \*\*IsSuppressed\*\*: True if the current muzzle is a suppressor. ### Zero \* \*\*ZeroOpticsForZeroAtLocation\*\*: Zeroes every magnified optic on the firearm to a location, usually where the bullet is at the zero distance. Get that location from \`GetProjectileLocationAtDistance\` on the SKGProjectileWorldSubsystem. ### Light Laser Each one calls the matching function on every \[SKGLightLaserComponent\](/skgsfdocs/components/skglightlasercomponent.md) on the firearm. \* \*\*ToggleAllLights\*\* / \*\*ToggleAllLasers\*\* / \*\*ToggleAllLightsStrobe\*\* / \*\*CycleAllLightsIntensity\*\* \* \*\*TurnAllLightsOn\*\* / \*\*TurnAllLightsOff\*\* / \*\*TurnAllLasersOn\*\* / \*\*TurnAllLasersOff\*\* \* \*\*SetAllLightLaserInfraredMode\*\*: Switches every light and laser to or from infrared. ### Pose \* \*\*GetPose\*\*: Finds a pose by gameplay tag on the firearm's SKGProceduralAnimComponent. Returns true if found. See \[Creating a custom pose\](/skgsfdocs/setup-guides/creating-a-custom-pose.md). ### Firearm Stats \* \*\*GetFirearmStats\*\*: The base stats with every attachment's stats applied. \* \*\*SetFirearmStats\*\*: Replaces the current stats and fires On Firearm Stats Changed. Call it on the server so the change replicates. \* \*\*AddFirearmAttachmentStats\*\* / \*\*RemoveFirearmAttachmentStats\*\*: Override these in a Blueprint child of this component to change how attachment stats are applied. ### Procedural Stats Lets the firearm stats change how it handles, such as a heavier build aiming slower. \* \*\*GetProceduralStats\*\* / \*\*SetProceduralStats\*\*: The aim speed, sway, lag and recoil values the animation uses. They start from the firearm's SKGProceduralAnimComponent. \* \*\*CalculateProceduralValues\*\*: Resets the procedural stats to the SKGProceduralAnimComponent's values, then fires Calculate Procedural Stats. Runs whenever the firearm stats change. ### Getters \* \*\*GetCurrentProceduralAnimComponent\*\* / \*\*GetCurrentOffhandIKComponent\*\* / \*\*GetCurrentMuzzleComponent\*\* / \*\*GetCurrentOpticComponent\*\* / \*\*GetCurrentStockComponent\*\*: The component in use right now. \* \*\*GetProceduralAnimComponents\*\* / \*\*GetOffhandIKComponents\*\* / \*\*GetMuzzleComponents\*\* / \*\*GetLightLaserComponents\*\* / \*\*GetAttachmentStatComponents\*\*: Every component of that type on the attachments. GetLightLaserComponents also includes the firearm's own. \* \*\*GetFirearmProceduralAnimComponent\*\* / \*\*GetFirearmOffhandIKComponent\*\* / \*\*GetFirearmMuzzleComponent\*\* / \*\*GetFirearmOpticComponent\*\* / \*\*GetFirearmLightLaserComponent\*\*: The component on the firearm itself, not on an attachment. \* \*\*GetAttachmentManagerComponent\*\*: The manager from Attachment Manager Component Name. ### Other \* \*\*GetFirearmComponent\*\*: Returns the SKGFirearmComponent on an actor. \* \*\*GetParentFirearmComponent\*\* / \*\*GetParentWithFirearmComponent\*\*: Returns the firearm component, or the firearm actor, that an attachment belongs to. ## Events \* \*\*On Aiming Device Cycled\*\*: When the current aiming device changes. Passes the new one. \* \*\*On Procedural Anim Components Updated\*\*: When an aiming device is added or removed. \* \*\*On Muzzle Component Updated\*\*: When the current muzzle changes, such as when a suppressor is added. \* \*\*On Held\*\*: When an SKGShooterPawnComponent starts holding the firearm. \* \*\*On Firearm Stats Changed\*\*: When attachments change the firearm stats. Passes the new stats. \* \*\*Calculate Procedural Stats\*\*: After CalculateProceduralValues resets the procedural stats. Change the values you want and call \`SetProceduralStats\`. --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgfirearmcomponent.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skglightlasercomponent.md). # SKGLightLaserComponent This component is optional. It runs a flashlight, laser, or both, such as a weapon light, a PEQ or a handheld flashlight. Lights can strobe, and both can switch to infrared so they only show through night vision. Add one to the light or laser attachment, or to the firearm if it's built in. See \[Setting up a light and laser\](/skgsfdocs/setup-guides/setting-up-a-light-and-laser.md) for a step by step setup. Infrared only shows for a player while infrared mode is on, covered in \[Setting up night vision\](/skgsfdocs/setup-guides/setting-up-night-vision.md). The component finds its parts on the same actor by name: \* \*\*Light\*\*: Any light component, such as a Spot Light. \* \*\*Laser\*\*: A laser beam mesh and a laser dot mesh. Both are needed. The beam is stretched along its Y axis to whatever it hits, and the dot is moved to the hit. The provided SM\\\_Laser and SM\\\_LaserDot in SKGSFCore/LightLaser are set up for this. !\[BP\\\_LightLaser's components, with LaserMesh, LaserDot and SpotLight found by name\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-ed1794d836ab469af07e7c8c9710c46bfc6f2291%2Fcomponents.png?alt=media) Set everything on the component and leave the Data Asset fields empty. Using data assets as templates is covered in \[Data Assets\](/skgsfdocs/getting-started/data-assets.md). ## Settings ### Initialize !\[BP\\\_LightLaser's Initialization Settings\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-5d5f5078162d9630c99275cdbc915f6a87ab32ed%2Finitialization-settings.png?alt=media) \* \*\*Auto Initialize\*\*: Sets up the component on BeginPlay. If you turn this off, call \`InitializeLightLaserComponent\` yourself. \* \*\*Override Component Names\*\*: Only for setting the component names from C++. Leave off. \* \*\*Initialization Settings Data Asset\*\*: Leave empty and use Initialization Settings. #### Initialization Settings \* \*\*Light Component Name\*\*: Name of the light component. Leave as None if there's no light. \* \*\*Laser Mesh Component Name\*\* / \*\*Laser Dot Component Name\*\*: Names of the laser beam and laser dot meshes. Leave as None if there's no laser. \* \*\*Has Infrared Mode\*\*: Lets the light and laser switch to infrared. Infrared modes are skipped when this is off. \* \*\*Infrared Light Function Material\*\*: The light function used for the infrared light, so it only shows through night vision. Use M\\\_IRLightFunction from SKGSFCore. Without it, the light stays dark in infrared. \* \*\*Auto Call Force Net Update\*\*: Sends mode changes to other players right away, useful if the actor's net update frequency is low. \* \*\*Gameplay Tags\*\*: Tags you can use to identify this component in your own logic. ### Settings \* \*\*Light Laser Settings Data Asset\*\*: Leave empty and use Light Laser Settings. #### Laser Settings !\[BP\\\_LightLaser's Laser Settings\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-45099f6dd65903d9dac0e19a2e0f3d699d6e2eea%2Flaser-settings.png?alt=media) The laser stops at anything that blocks the Laser Collision Channel in \[Developer Settings\](/skgsfdocs/getting-started/developer-settings.md). The color, brightness, and infrared flag are written to the beam and dot meshes' custom primitive data at the Custom Primitive Index settings which match M\\\_Laser\\\_Master and M\\\_LaserDot\\\_Master that SM\\\_Laser and SM\\\_LaserDot come with. \* \*\*Laser Color\*\*: Color of the beam and dot. \* \*\*Laser Brightness\*\* / \*\*Laser Dot Brightness\*\*: Brightness of the beam and dot. \* \*\*Infrared Laser Brightness\*\* / \*\*Infrared Laser Dot Brightness\*\*: Brightness of the beam and dot in infrared. \* \*\*Max Laser Distance\*\*: How far the laser reaches in cm, 200000 (2 km) in the example. Past this, the beam stops and the dot hides. \* \*\*Laser Scale Factor\*\*: The length of the laser beam mesh in cm, so it stretches to the right length. 20 for SM\\\_Laser. #### Light Settings !\[BP\\\_LightLaser's Light Settings, with three brightness levels\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-c5c86595dfcb2c9a8ec3c50052b63f86ecc853ad%2Flight-settings.png?alt=media) \* \*\*Light Strobe Interval\*\*: Seconds between the light flashing on and off while strobing. \* \*\*Light Intensities\*\*: The brightness levels \`CycleLightIntensity\` steps through, such as 2, 6 and 12 in the example. \* \*\*Light Intensities Infrared\*\*: The brightness levels used in infrared. #### Cycle Modes Each entry's Mode is a mix of the On, IR and Strobe flags. (No Flags Set) is off. \* \*\*Laser Cycle Modes\*\*: The modes \`CycleLaserMode\` steps through. By default (No Flags Set), On, then On | IR. \* \*\*Light Cycle Modes\*\*: The modes \`CycleLightMode\` steps through. By default (No Flags Set), On, On | IR, On | Strobe, then On | IR | Strobe. !\[The default Laser Cycle Modes and Light Cycle Modes\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-1871796f58b200dbf1749bc93a491e46377a3304%2Fcycle-modes.png?alt=media) ## Functions Everything that changes a mode can be called on the client. The change is sent to the server and every player sees it. ### Initialize \* \*\*InitializeLightLaserComponent\*\*: Sets up the component from its settings. Called for you on BeginPlay when Auto Initialize is on. \* \*\*InitializeLightLaserComponentFromSettings\*\*: Sets up the component from the settings you pass in. ### Light and Laser \* \*\*CycleLightLaserMode\*\*: Steps both the light and laser to their next cycle mode. \* \*\*SetLightLaserMode\*\*: Sets the light and laser modes. \* \*\*TurnLightLaserOn\*\* / \*\*TurnLightLaserOff\*\*: Turns both on or off, keeping their infrared and strobe choices. \* \*\*SetLightLaserInfrared\*\*: Switches both in or out of infrared. ### Laser \* \*\*CycleLaserMode\*\*: Steps the laser to its next mode in Laser Cycle Modes. \* \*\*SetLaserCycleModeIndex\*\* / \*\*GetLaserCycleModeIndex\*\*: Sets or gets the laser's place in Laser Cycle Modes. \* \*\*SetLaserMode\*\* / \*\*GetLaserMode\*\*: Sets or gets the laser's flags. \* \*\*TurnLaserOn\*\* / \*\*TurnLaserOff\*\*: Turns the laser on or off, keeping its infrared choice. \* \*\*SetLaserInfraredMode\*\*: Switches the laser in or out of infrared. \* \*\*IsLaserOn\*\* / \*\*IsLaserInfrared\*\*: True if the laser is on, or set to infrared. ### Light \* \*\*CycleLightMode\*\*: Steps the light to its next mode in Light Cycle Modes. \* \*\*SetLightCycleModeIndex\*\* / \*\*GetLightCycleModeIndex\*\*: Sets or gets the light's place in Light Cycle Modes. \* \*\*SetLightMode\*\* / \*\*GetLightMode\*\*: Sets or gets the light's flags. \* \*\*TurnLightOn\*\* / \*\*TurnLightOff\*\*: Turns the light on or off, keeping its infrared and strobe choices. \* \*\*SetLightInfraredMode\*\* / \*\*SetLightStrobe\*\*: Switches the light in or out of infrared or strobe. \* \*\*CycleLightIntensity\*\*: Steps to the next brightness in Light Intensities, or Light Intensities Infrared while in infrared. \* \*\*SetLightIntensityIndex\*\*: Sets the brightness by its place in that list. \* \*\*IsLightOn\*\* / \*\*IsLightInfrared\*\*: True if the light is on, or set to infrared. \* \*\*IsLightStrobing\*\*: True if the light is on and set to strobe. \* \*\*IsLightStrobeEnabled\*\*: True if the light is set to strobe, even while it's off. ### Getters \* \*\*GetLightSource\*\* / \*\*GetLaserMesh\*\* / \*\*GetLaserDot\*\*: The components found from the names in Initialization Settings. \* \*\*IsInInfraredMode\*\*: True if the light or laser is set to infrared. ### Other \* \*\*GetLightLaserComponent\*\*: Returns the SKGLightLaserComponent on an actor. ## Events \* \*\*On Light Mode Changed\*\* / \*\*On Laser State Changed\*\*: When the light or laser mode changes, with the new flags. \* \*\*On Infrared Mode Changed\*\*: When the device goes in or out of infrared. \* \*\*On Light Strobed\*\*: Each time the strobing light flashes on or off. \* \*\*On Laser Impact\*\*: Every frame the laser is showing, with what it hit and whether it hit anything. --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skglightlasercomponent.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticscenecapturecomponent.md). # SKGOpticSceneCaptureComponent Renders the zoomed image for magnified optics in Picture in Picture mode. The \[SKGOpticComponent\](/skgsfdocs/components/skgopticcomponent.md) controls it, so it's set up through the optic's \[Scene Capture Settings\](/skgsfdocs/components/skgopticcomponent.md#scene-capture-settings) and you rarely need to call it directly. Only needed if your game uses Picture in Picture mode. See \[Setting up a magnified optic\](/skgsfdocs/setup-guides/setting-up-a-magnified-optic.md) for a step by step setup. ## Setup \* Add it to your optic Blueprint and attach it to the optic mesh, facing forward along the scope. \* Its name must match \*\*Optic Scene Capture Component Name\*\* on the SKGOpticComponent. The default is SKGOpticSceneCapture. \* The optic mesh needs an S\\\_ObjectiveLens socket and the reticle mesh needs an S\\\_RearLens socket. While capturing, the component moves to the objective lens and shifts with your eye position. The image changes as you move your head, like looking through lens instead of a camera. \* For digital and thermal optics, turn on \*\*Is Digital\*\* on the SKGOpticComponent. This turns that effect off, so the component stays where you placed it and acts like a camera showing its image on a screen. !\[SKGOpticSceneCapture attached to the optic mesh, facing forward\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-e7a428762087ae0d9f864da4a6591c35df31abe4%2Fscene-capture-setup.png?alt=media) ## Settings \* \*\*Gameplay Tags\*\*: Tags you can use to identify this capture in your own logic. ## Functions Zoom and zero are controlled through the \[SKGOpticComponent\](/skgsfdocs/components/skgopticcomponent.md). ### Tick \* \*\*StartCapture\*\* / \*\*StopCapture\*\*: Starts and stops rendering the scope image. Called by StartedAiming and StoppedAiming on the SKGOpticComponent. Does nothing in Normal mode. \* \*\*IsCapturing\*\*: True while the scope image is rendering. ### Shared View Only used when \*\*Use Shared View Family for Magnified Optics\*\* is on in the SKGOptic developer settings. The scope image is then rendered alongside the main view instead of by a separate scene capture. See \[Shared view family\](/skgsfdocs/setup-guides/setting-up-a-magnified-optic.md#shared-view-family). \* \*\*WarmUpSharedView\*\*: Renders the scope for a few frames without showing it, so the first aim doesn't hitch. Call it at a quiet moment, such as after equipping the weapon. Returns true if the warm up started. \* \*\*IsWarmingUpSharedView\*\*: True while the warm up is running. \* \*\*IsUsingSharedViewFamily\*\*: True if the scope image is rendered through the shared view family. ### Other \* \*\*GetOpticSceneCaptureComponent\*\*: Returns the SKGOpticSceneCaptureComponent on an actor. --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticscenecapturecomponent.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent.md). # SKGOpticComponent Handles everything an optic does: the reticle, brightness, zoom and zeroing. Add it to every optic, from a red dot to a magnified scope. On magnified optics it also drives the \[SKGOpticSceneCaptureComponent\](/skgsfdocs/components/skgopticscenecapturecomponent.md). See \[Setting up a red dot\](/skgsfdocs/setup-guides/setting-up-a-red-dot.md) and \[Setting up a magnified optic\](/skgsfdocs/setup-guides/setting-up-a-magnified-optic.md) for step by step setups. Set everything on the component in your optic Blueprint and leave the Data Asset fields empty. Using data assets as templates is covered in \[Data Assets\](/skgsfdocs/getting-started/data-assets.md). !\[SKGOpticComponent in the Details panel\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-35d226e540942da850141abdc1f992d817d5a930%2Fdetails-panel.png?alt=media) ## Settings ### Initialize \* \*\*Auto Initialize\*\*: Sets up the optic on Begin Play. If you turn this off, call \`InitializeOpticComponent\` yourself. \* \*\*Override Component Names\*\*: Only for setting the component names from C++. Leave off. ### Initialization Settings \* \*\*Gameplay Tags\*\*: Tags you can use to identify this optic in your own logic. \* \*\*Optic Mesh Name\*\*: Name of the optic's mesh component. \* \*\*Optic Reticle Mesh Name\*\*: Name of the mesh component that holds the reticle material. Use the same name as Optic Mesh Name if the reticle is on the optic mesh. \* \*\*Is Magnifier\*\*: Turn on for magnifiers that sit behind another optic. !\[Mesh component names\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-f7d4869cc16ad9b46f869435bf5988c8e96a9905%2Fcomponent-names.png?alt=media) #### Quality Settings \* \*\*Reticle Distortion Type\*\*: Bends the reticle with the lens. Planar for red dots and holographics, Spherical for magnified optics. !\[Planar on a holographic sight (left) and Spherical on an LPVO (right)\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-70e7b98c042cc055aa71e79bc143704fcf538b13%2Freticle-distortion.png?alt=media) \* \*\*Reticle Distortion Strength\*\*: How strong the reticle distortion is. \* \*\*Chromatic Aberration\*\*: Color fringing toward the edge of the lens. 0 turns it off. !\[Color fringing toward the edge of the lens\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-54d3140ff062340428ab85d59099c6df0be8d841%2Fchromatic-aberration.png?alt=media) \* \*\*Lens Distortion Strength\*\*: Magnified optics only. How much the image bends at the edge of the lens. 0 turns it off. \* \*\*Lens Distortion Start Offset\*\*: Where the edge distortion starts. 0 is the center of the lens, 1 is the edge. #### Magnification Settings \* \*\*Is Magnified\*\*: Turn on for any optic that zooms in. The rest of this group only applies when it's on. \* \*\*Use Min Max Magnification\*\*: Off steps through the Magnifications list. On zooms freely between Min and Max Magnification. \* \*\*Magnifications\*\*: The zoom levels, lowest first. A 1-8x scope might use 1, 3, 6 and 8. The optic starts on the first entry. \* \*\*Min Magnification\*\* / \*\*Max Magnification\*\*: The zoom range when Use Min Max Magnification is on. The optic starts at the minimum. \* \*\*Magnification Curve\*\*: Optional. Maps a zoom ring position (0 to 1) to a magnification for \`SetZoomPosition\`. Without it the mapping is linear. \* \*\*Sensitivity Scale\*\*: Aim sensitivity is divided by this while aiming through the optic. 2 halves it. \* \*\*Smooth Zoom\*\*: Changes magnification gradually instead of instantly. \* \*\*Smooth Zoom Rate\*\*: How fast smooth zoom moves, in magnification per second. \* \*\*Smooth Zoom Speed Scaling\*\*: 0 keeps the zoom speed the same at every magnification. 1 slows it down at higher magnification. \* \*\*Is First Focal Plane\*\*: On, the reticle grows as you zoom in (first focal plane). Off, it stays the same size (second focal plane). !\[Magnification settings\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-7b92c0e7d45a91dbd9a4b67d17c748903a0d69af%2Fmagnification-settings.png?alt=media) #### Scene Capture Settings Used in Picture in Picture mode by magnified optics with an \[SKGOpticSceneCaptureComponent\](/skgsfdocs/components/skgopticscenecapturecomponent.md). \* \*\*Optic Scene Capture Component Name\*\*: Name of the SKGOpticSceneCaptureComponent on the optic. \* \*\*Is Digital\*\*: Turn on for digital and thermal optics. The image comes from where the capture component is placed instead of following your eye. \* \*\*Use Tick Interval\*\*: Off uses Tick Frequency. On uses Tick Interval. \* \*\*Tick Frequency\*\*: How many frames to skip between captures. 0 captures every frame, 1 every other frame. \* \*\*Tick Interval\*\*: How many times per second to capture. 0 captures every frame. \* \*\*Size Render Target to Lens\*\*: Only renders the part of the screen the lens covers. Leave on for best performance. \* \*\*Lens Coverage Margin\*\*: Extra space around the lens. Raise it slightly if the image wraps at the edge. \* \*\*Min Render Target Size\*\* / \*\*Max Render Target Size\*\*: Limits for the render target size, in pixels. \* \*\*Resolution Reduction Amount\*\*: Used when Size Render Target to Lens is off. 1 renders at screen resolution, 2 at half. \* \*\*Texture Render Target Format\*\*: Leave at RGBA16f. \* \*\*Composite in Post Process\*\*: Draws the scope image in post process after the main view. This removes most of the blur from temporal anti-aliasing. \* \*\*Post Process Composite Material\*\*: The material used by Composite in Post Process. Use PPM\\\_MagnifiedOpticBeforeBloom. \* \*\*Custom Depth Stencil Value\*\*: Stencil value used to find the lens on screen. 0 picks one for you. Don't use the night vision stencil value (25 by default). \* \*\*Lens Plane Depth Tolerance\*\*: Leave at the default. \* \*\*Reticle Plane Socket Name\*\*: Socket where the reticle is drawn. Uses S\\\_RearLens if the socket doesn't exist. \* \*\*Reticle Plane Forward Offset\*\*: Moves the reticle plane forward from that socket, in cm. #### Normal Scope Settings Used in Normal mode by magnified optics. \* \*\*Aperture Radius\*\*: Radius of the lens opening, in cm. Parts of the scope inside this radius are hidden so they don't block your view. Only affects materials that use MF\\\_NormalScopeCutout. 0 turns this off. \* \*\*Aperture Socket Name\*\*: Socket on the optic mesh at the lens opening. Uses S\\\_RearLens if the socket doesn't exist. \* \*\*Aperture Forward Offset\*\*: Moves the opening forward along the scope, in cm. \* \*\*Zoom Post Process Material\*\*: Draws the lens effects and the in-lens zoom. Use PPM\\\_NormalScopeZoom. Leave empty to do all zooming with the camera. \* \*\*In Scope Zoom Share\*\*: How much of the zoom happens inside the lens instead of through the camera. 0 zooms only with the camera. \* \*\*Reticle Sort Distance Offset\*\*: Draws the reticle in front of the lens glass. Raise it if the glass covers the reticle. #### Light Transmission \* \*\*Light Transmission\*\*: How much light passes through the optic. 1 loses none, 0.5 loses half. \* \*\*Night Vision Light Transmission\*\*: Same as above, used while night vision is on. #### Field Stop Settings The field stop is the dark ring around the scope image. Its size sets the optic's field of view, meaning how much you can see through it. Take these values from the scope's spec sheet, which lists field of view in feet at 100 yards. For example, the defaults match the Nightforce ATACR 1-8x, which sees 96.1 ft at 1x. The Vortex Razor HD Gen III 1-10x sees 116 ft at 1x, so its ring is wider and shows more of the scene. \* \*\*FOVDistance\*\*: The distance the spec sheet measures field of view at, in yards. Usually 100. \* \*\*Low Magnification FOV\*\* / \*\*High Magnification FOV\*\*: Field of view at the lowest and highest magnification, in feet. \* \*\*Apply Manual Field Stop Data\*\*: Turn on to enter the half angles below yourself. Off calculates them from the values above. \* \*\*Low Magnification Field Stop Half Angle\*\* / \*\*High Magnification Field Stop Half Angle\*\*: The field stop size, in degrees. \* \*\*Field Stop Softness Angle\*\*: How soft the edge of the ring is. #### Eye Relief Settings Controls the eyebox: how close and how centered your eye needs to be to see through the scope. Take these values from the spec sheet. Eyebox Eye Pupil Radius and Eyebox Exit Pupil Tolerance in \[Developer Settings\](/skgsfdocs/getting-started/developer-settings.md) apply to every optic. \* \*\*Low Magnification Eye Relief\*\* / \*\*High Magnification Eye Relief\*\*: Eye relief at the lowest and highest magnification, in inches. \* \*\*Objective Lens Diameter\*\*: Diameter of the front lens, in mm. For example 24 on an LPVO or 56 on a long range scope. \* \*\*Use Default Exit Pupil Diameter\*\*: On calculates the exit pupil from the objective lens diameter. Turn off if the spec sheet lists it. \* \*\*Low Magnification Exit Pupil Diameter\*\* / \*\*High Magnification Exit Pupil Diameter\*\*: Exit pupil at the lowest and highest magnification, in mm. ### Reticle Settings \* \*\*Reticle Material Index\*\*: The material slot (Element) on the reticle mesh that shows the reticle. Use whichever slot your mesh has the reticle on. In the example project, the holographic sight uses slot 1 on its main mesh, and the LPVO keeps its reticle on a separate mesh (StaticMeshReticle) at slot 0. !\[Reticle material slot on the holographic sight\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-f055ab937618db5e978f0fd72f5a3efce3098687%2Freticle-index-holo.png?alt=media) \* \*\*Supports Night Vision\*\*: Allows switching to the night vision brightness levels. \* \*\*Reticle Material\*\*: The material applied to that slot. The provided reticle materials are in SKGSFCore/Materials/Optic. \* \*\*Normal Reticle Material\*\*: Magnified optics only. The material used in Normal mode. Required for Normal mode. \* \*\*Reticle Textures\*\*: The reticles you can switch between with \`CycleReticle\`. The optic starts on the first one. \* \*\*Reticle Texture\*\*: The reticle image. \* \*\*Reticle Size\*\*: Size of the reticle. \* \*\*Red Channel Color\*\* / \*\*Green Channel Color\*\* / \*\*Blue Channel Color\*\*: Optional. Recolors the parts of the reticle drawn in each channel of the texture. The example uses this to make a red and a green version of the same reticle. At their defaults (red, green, blue) the texture keeps its own colors, so a solid red dot or solid green dot texture works without changing them. \* \*\*Un Aimed Capture Delay\*\*: Magnified optics only. Seconds after you stop aiming before the scope image stops updating. \* \*\*Reticle Brightness Parameter Name\*\*: Leave as is when using the provided materials. \* \*\*Reticle Brightness Settings\*\*: Brightness levels, dimmest first. The optic starts on the first. \* \*\*Reticle Night Vision Brightness Settings\*\*: Brightness levels used in night vision mode. \* \*\*Weighted Blendables\*\*: Post process materials applied to the scope image, such as thermal color palettes. Switch between them with \`CycleNextWeightedBlendable\`. Picture in Picture only. !\[Reticle textures\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-fc65478ace4cb959e891044d71b30a535f53c5dd%2Freticle-textures.png?alt=media) ### Optic Zero Settings Magnified optics only. \* \*\*Adjustment Type\*\*: MRAD or MOA turret adjustments. \* \*\*MRADAdjustment Amount\*\* / \*\*MOAAdjustment Amount\*\*: How far one click moves the point of impact. \* \*\*Starting Zero Settings\*\* \* \*\*Start with Default Zero\*\*: Starts with the default clicks already dialed in. \* \*\*Default Elevation Clicks\*\* / \*\*Default Windage Clicks\*\*: The clicks to start with. \* \*\*Start with Random Zero\*\*: Starts with a random number of clicks, up to the max values below in either direction. \* \*\*Random Max Elevation Clicks\*\* / \*\*Random Max Windage Clicks\*\*: The most random clicks to start with. !\[Zero settings\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-d8c4aa6511794d72be775cd59dcfef263e9363e9%2Fzero-settings.png?alt=media) ## Functions ### SKG Optic \* \*\*StartedAiming\*\* / \*\*StoppedAiming\*\*: Starts and stops the scope image on magnified optics. The SKGFirearmComponent and SKGShooterPawnComponent call these for you when aiming. Stop Capture Immediately skips the Un Aimed Capture Delay. \* \*\*InitializeOpticComponent\*\*: Sets up the optic from its settings. Called on Begin Play when Auto Initialize is on. Call it again if you change settings at runtime. \* \*\*InitializeOpticComponentFromSettings\*\*: Sets up the optic from the settings you pass in. \* \*\*IsMagnifiedOptic\*\*: Returns true if Is Magnified is on. \* \*\*IsMagnifier\*\*: Returns true if Is Magnifier is on. \* \*\*GetOpticMesh\*\* / \*\*GetOpticReticleMesh\*\*: Returns the optic and reticle mesh components. \* \*\*GetOpticSceneCaptureComponent\*\*: Returns the SKGOpticSceneCaptureComponent, if the optic has one. \* \*\*GetPlayerCameraComponent\*\*: Returns the player camera the optic is using. \* \*\*SetOpticActive\*\* / \*\*IsOpticActive\*\*: Set by StartedAiming and StoppedAiming. You won't normally need these. \* \*\*SetupLocalPlayerCamera\*\*: Finds the local player's camera. This happens automatically. Only call it for custom ownership setups. ### Reticle \* \*\*CycleReticle\*\*: Switches to the next entry in Reticle Textures. \* \*\*IncreaseReticleBrightness\*\* / \*\*DecreaseReticleBrightness\*\*: Moves up or down the Reticle Brightness Settings. Uses the night vision levels while night vision mode is on. \* \*\*ToggleReticleNightVisionSetting\*\*: Switches between the normal and night vision brightness levels. Needs Supports Night Vision and at least one night vision brightness level. \* \*\*CycleNextWeightedBlendable\*\*: Switches to the next Weighted Blendable, such as the next thermal palette. ### Zoom Magnified optics only. \* \*\*ZoomIn\*\* / \*\*ZoomOut\*\*: Moves to the next or previous entry in Magnifications. With Use Min Max Magnification, changes the magnification by Zoom Step instead. \* \*\*SetZoomPosition\*\*: Sets the zoom from a ring position between 0 and 1, for example from a VR zoom dial. Needs Use Min Max Magnification. \* \*\*GetCurrentMagnification\*\*: The magnification the optic is set to. \* \*\*GetInterpolatedMagnification\*\*: The magnification right now, including smooth zoom in progress. \* \*\*GetCurrentZoomPosition\*\*: The zoom ring position between 0 and 1. Use with On Magnification Changed to rotate a zoom ring mesh. \* \*\*GetMinMagnification\*\* / \*\*GetMaxMagnification\*\*: The lowest and highest magnification. \* \*\*GetMagnificationSensitivityScale\*\*: Returns Sensitivity Scale. \* \*\*GetCurrentMagnificationFOV\*\*: The field of view of the scene capture. Returns 1 if there isn't one. ### Zero Magnified optics only. \* \*\*PointOfImpactUp\*\* / \*\*PointOfImpactDown\*\* / \*\*PointOfImpactLeft\*\* / \*\*PointOfImpactRight\*\*: Moves the point of impact by the given number of clicks. Each click moves it by the Adjustment Amount, so 10 clicks at .1 MRAD is 1 mil. \* \*\*PointOfImpactUpDownDefault\*\* / \*\*PointOfImpactLeftRightDefault\*\*: Returns elevation or windage to zero. Returns how many clicks were dialed in before the reset. \* \*\*ApplyLookAtRotationZero\*\*: Zeroes the optic to a rotation. Normally called for you by ZeroOpticsForZeroAtLocation on the \[SKGFirearmComponent\](/skgsfdocs/components/skgfirearmcomponent.md). \* \*\*GetZeroRotation\*\*: The current zero adjustment as a rotation. ### Mode Magnified optics only. \* \*\*SetMagnifiedOpticMode\*\* / \*\*GetMagnifiedOpticMode\*\*: Picture in Picture or Normal. The SKGShooterPawnComponent sets this from the player's setting, so you normally change it through the SKGShooterLocalPlayerSubsystem instead. ### Normal Magnified optics in Normal mode only. \* \*\*IsNormalScopeCutoutEnabled\*\*: True while the aperture cutout is active. \* \*\*GetNormalScopeCutoutMeshCount\*\*: How many meshes the cutout is applied to. \* \*\*IsNormalScopeZoomActive\*\*: True while the Zoom Post Process Material is active. \* \*\*GetNormalScopeZoom\*\*: The zoom applied inside the lens. \* \*\*GetNormalCameraMagnification\*\*: The zoom applied through the camera. ### Other \* \*\*GetOpticComponent\*\*: Returns the SKGOpticComponent on an actor. ## Events Bind these to update UI, play sounds or animate parts. They fire on the local client. \* \*\*On Magnification Changed\*\*: Every time the magnification changes, including each step of smooth zoom. \* \*\*On Zoom Changed\*\*: When ZoomIn, ZoomOut or SetZoomPosition changes the zoom. Zoomed In is true when zooming in. \* \*\*On Reticle Cycled\*\*: After CycleReticle. \* \*\*On Reticle Brightness Changed\*\*: After IncreaseReticleBrightness or DecreaseReticleBrightness. Was Successful is false when already at the top or bottom level. \* \*\*On Night Vision Mode Changed\*\*: After ToggleReticleNightVisionSetting. \* \*\*On Point of Impact Changed\*\*: After any zero change, with the total elevation and windage clicks. \* \*\*On Point of Impact Up/Down/Left/Right Changed\*\*: After a click in that direction. \* \*\*On Point of Impact Up Down Reset\*\* / \*\*On Point of Impact Left Right Reset\*\*: After returning to zero. \* \*\*On Scene Capture State Changed\*\*: When the scope image starts or stops. \* \*\*On Magnified Optic Mode Changed\*\*: When switching between Picture in Picture and Normal. --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgopticcomponent.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentmanagercomponent.md). # SKGAttachmentManagerComponent This component is optional. You can use your own attachment system instead and call \`AddAttachment\` and \`RemoveAttachment\` on the \[SKGFirearmComponent\](/skgsfdocs/components/skgfirearmcomponent.md) whenever an attachment is added or removed. Keeps track of every \[SKGAttachmentComponent\](/skgsfdocs/components/skgattachmentcomponent.md) and attachment on an actor, including slots that come with an attachment, such as the rail slots on a handguard. Add one to the root actor, such as the firearm. It gives you one place to find slots and attachments, hide them, and listen for changes. See \[Setting up attachments\](/skgsfdocs/setup-guides/setting-up-attachments.md) for a step by step setup. Set \*\*Attachment Manager Component Name\*\* on the \[SKGFirearmComponent\](/skgsfdocs/components/skgfirearmcomponent.md) to this component's name, and the firearm adds and removes attachments for you. !\[BP\\\_BoltGun's SKGFirearm pointing to its SKGAttachmentManager component\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-95b787182b1554f244b34d9394628fd549647c66%2Ffirearm-manager-name.png?alt=media) ## Settings !\[The attachment manager's Initialize settings\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-659d37f593fda0dc94c0c3803efd23c525839a7e%2Fdetails-panel.png?alt=media) ### Initialize \* \*\*Manager Name\*\*: Optional name for this manager. The example's customization menu uses it as the folder name for saved presets. \* \*\*Allow Client Side Modification\*\*: Lets clients hide, unhide and change collision on all attachments. If off, only the server can, and a client that tries anyway is disconnected. \* \*\*Auto Call Force Net Update\*\*: Forces a network update whenever a slot or attachment is added or removed, or the hidden or collision state changes. Useful if the actor's Net Update Frequency is very low. \* \*\*Gameplay Tags\*\*: Tags you can use to identify this manager in your own logic. ## Functions ### Attachments \* \*\*GetAttachmentComponents\*\*: Every slot on the actor. Break each item to get its Attachment Component. \* \*\*GetAttachments\*\*: Every attachment on the actor. \* \*\*GetAttachmentComponentWithAttachment\*\*: The slot holding the given attachment. \* \*\*GetCompatibleAttachmentComponentsFromObject\*\* / \*\*GetCompatibleAttachmentComponentsFromClass\*\* / \*\*GetCompatibleAttachmentComponentsFromConstructionDataAsset\*\*: Every slot that accepts the given attachment, class or data asset. Returns true if at least one is found. Useful for showing where an attachment can go in a customization menu. \* \*\*GetAttachmentComponentWithTag\*\*: The first slot with the gameplay tag in its Gameplay Tags. \* \*\*GetAttachmentComponentWithQuery\*\* / \*\*GetAttachmentComponentsWithQuery\*\*: The first slot, or every slot, whose Gameplay Tags match the query. \* \*\*GetAttachmentComponentWithSlotTag\*\*: The slot whose Slot Tag matches. See \[Compatibility\](/skgsfdocs/components/skgattachmentcomponent.md#compatibility). \* \*\*GetAttachmentWithTag\*\*: The first attachment with the gameplay tag, such as the first optic. This requires the attachments to have implemented the gameplay tags interface, such as Blueprints based on SKGBaseActor. ### Attachment State These apply to every attachment, including ones added later. Changes made on a client are sent to the server when Allow Client Side Modification is on. \* \*\*HideAllAttachments\*\* / \*\*UnhideAllAttachments\*\*: Hides or shows every attachment. \* \*\*DisableCollisionAllAttachments\*\* / \*\*EnableCollisionAllAttachments\*\*: Turns collision off or on for every attachment. \* \*\*DestroyAllAttachments\*\*: Destroys every attachment. Include Self also destroys the actor that owns the manager. ### Registering For an attachment that isn't in an SKGAttachmentComponent, such as one you attach yourself. Server only. \* \*\*RegisterAttachmentComponentsAttachmentNoComponent\*\*: Adds the actor to the manager's attachments. It's then included in GetAttachments, the attachment state functions and the events, and the SKGFirearmComponent picks it up like any other attachment. \* \*\*UnregisterAttachmentComponentsAttachmentNoComponent\*\*: Removes it again. ### Getters \* \*\*GetManagerName\*\*: Returns Manager Name. ### Other These are in the SKGAttachmentHelpers library. \* \*\*GetAttachmentManagerComponent\*\*: Finds the SKGAttachmentManagerComponent on an actor. #### Saving and loading builds Saves which attachment is in which slot, along with its offset, so a build can be rebuilt later, such as a preset in a customization menu. Slots are matched by their component name, so renaming a slot breaks builds saved before the rename. \* \*\*ConstructAttachmentManagerData\*\*: Builds the save data from the manager: the actor's class, and the class, slot and offset of every attachment. \* \*\*SerializeAttachmentManagerToJson\*\* / \*\*DeserializeAttachmentManagerJson\*\*: Turns the save data into a JSON string and back, for saving to a file or sending over the network. \* \*\*ConstructActorFromAttachmentManagerData\*\*: Spawns the actor and sets up the saved attachments in place of its default attachments. \* \*\*ConstructExistingActorFromAttachmentManagerData\*\*: Replaces the attachments on an existing actor with the saved ones. ## Events \* \*\*On Attachment Components Changed\*\*: When a slot is added or removed. Fires on the server and clients. \* \*\*On Attachments Changed\*\*: When an attachment is added or removed. Fires on the server and clients. \* \*\*On Attachment Component Added\*\* / \*\*On Attachment Component Removed\*\*: Same as On Attachment Components Changed, but passes the slot. \* \*\*On Attachment Component Attachment Added\*\* / \*\*On Attachment Component Attachment Removed\*\*: Same as On Attachments Changed, but passes the attachment. --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentmanagercomponent.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgstockcomponent.md). # SKGStockComponent This component is optional. It sets the length of pull, which moves the firearm forward or back from the shoulder, such as when an M4 stock is extended or collapsed or an underfolding AK stock is folded. Without it, the length of pull is 0. Add the SKGStock component to the stock's attachment actor. A stock has to be an attachment, the component is ignored when it's placed on the firearm itself as it is designed to be used with the attachment system. The \[SKGFirearmComponent\](/skgsfdocs/components/skgfirearmcomponent.md) finds it for you and the provided anim layer applies the length of pull. ## Settings !\[BP\\\_M4\\\_Stock's SKGStock settings, following its rail offset\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-3f0d69bcc827bbd5df6749c6fcefb06984913768%2Fdetails-panel.png?alt=media) ### Initialize \* \*\*Can be Folded\*\*: Lets the stock fold, such as an underfolding AK or an MCX. \* \*\*Can be Affected by Offset\*\*: Lets the stock's rail offset change the length of pull, such as sliding an M4 stock along the buffer tube. The SKGFirearmComponent handles this for you when the stock is attached with an \[SKGAttachmentComponent\](/skgsfdocs/components/skgattachmentcomponent.md). The offset is ignored while folded. \* \*\*Unfolded Length Of Pull\*\*: The length of pull in cm when unfolded. Higher moves the firearm further forward from the shoulder. \* \*\*Folded Length Of Pull\*\*: The length of pull in cm when folded. For an underfolding AK, Unfolded Length Of Pull might be 0 and Folded Length Of Pull -3. ## Functions ### Fold \* \*\*Fold\*\* / \*\*Unfold\*\* / \*\*ToggleFold\*\*: Folds or unfolds the stock if Can be Folded is on. Can be called on the client, the change is sent to the server. \* \*\*IsFolded\*\*: True if the stock is folded. \* \*\*CanBeFolded\*\*: Returns Can be Folded. \* \*\*CanBeAffectedByOffset\*\*: Returns Can be Affected by Offset. ### Length of Pull \* \*\*SetOffset\*\*: Changes the length of pull by an offset, such as how far the stock is slid along the buffer tube. The offset is subtracted from Unfolded Length Of Pull. Call on the server. The SKGFirearmComponent calls it for you when the stock is attached with an SKGAttachmentComponent. \* \*\*GetLengthOfPull\*\*: The current length of pull, including the offset. \* \*\*GetUnfoldedLengthOfPull\*\* / \*\*GetFoldedLengthOfPull\*\*: Returns Unfolded Length Of Pull or Folded Length Of Pull. ### Other \* \*\*GetStockComponent\*\*: Returns the SKGStockComponent on an actor. ## Events \* \*\*On Folded\*\*: When the stock folds or unfolds, with whether it's folded. \* \*\*On Length Of Pull Changed\*\*: When the length of pull changes, with the new length of pull. --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgstockcomponent.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgobjecttemperaturecomponent.md). # SKGObjectTemperatureComponent This component is optional. It makes meshes show up hot in thermal optics, such as a player's body, and can cool them down over time, such as a body after death. Add one to the actor, and give each mesh that should be hot a component tag, such as Hot. Each tagged mesh gets Render CustomDepth Pass turned on and a custom depth stencil value based on its heat, from 0 (cold) to 1 (hottest). Thermal post process materials, such as an optic's thermal Weighted Blendables, read that stencil. See \[Digital and thermal optics\](/skgsfdocs/setup-guides/setting-up-a-magnified-optic.md#digital-and-thermal-optics). The stencil range comes from ThermalHotStencilMin and ThermalHotStencilMax in the material parameter collection set in Project Settings > Plugins > SKG Shooter Framework Temperature Settings, MPC\\\_SKGSF in the example. See \[Developer Settings\](/skgsfdocs/getting-started/developer-settings.md). Custom Depth-Stencil Pass in Project Settings > Rendering must be set to Enabled with Stencil. !\[The Temperature Material Parameter Collection set to MPC\\\_SKGSF\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-d4e6336410caaa9a9354d956bbb317de6f4a2d30%2Fdeveloper-settings.png?alt=media) The example's BP\\\_PlayerPawn is hot, and BP\\\_ThermalBodyExample in Misc cools down. !\[BP\\\_ThermalBodyExample's SkeletalMesh with the Hot component tag\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-c7f908f88b3f00304dc21a4665eecbb94367318d%2Fhot-tag.png?alt=media) Set everything on the component and leave the Data Asset field empty. Using data assets as templates is covered in \[Data Assets\](/skgsfdocs/getting-started/data-assets.md). ## Settings !\[The SKGObjectTemperature component's settings\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-970887bfbb15e012775f39d3e41634610bd5dd2f%2Fsettings.png?alt=media) ### Initialize \* \*\*Auto Initialize\*\*: Sets up the component on BeginPlay. Turn it off to call \`SetupObjectTemperatureComponent\` yourself, such as with your own list of meshes. ### Settings \* \*\*Temperature Settings Data Asset\*\*: Leave empty and use Temperature Settings. #### Temperature Settings \* \*\*Hot Component Tag\*\*: The component tag on each mesh that should be hot, Hot in the example. Add it in the mesh's Details panel under Tags > Component Tags. \* \*\*Time to Cool\*\*: Seconds to cool from fully hot to cold, 20 by default. \* \*\*Starting Heat Value\*\*: The heat it starts with, from 0 (cold) to 1 (hottest). ## Functions ### Setup \* \*\*SetupObjectTemperatureComponent\*\*: Sets up the component from the data asset you pass in, or from its own settings if you pass none. Meshes in Component Override are used instead of searching for Hot Component Tag. Called for you on BeginPlay with Auto Initialize on. \* \*\*SetupObjectTemperatureComponentFromSettings\*\*: Same as SetupObjectTemperatureComponent, but from the settings you pass in. ### Heat \* \*\*SetHeatValue\*\*: Sets the heat from 0 (cold) to 1 (hottest). Call it on the server. Every player sees it. \* \*\*StartCooling\*\*: Starts cooling down to 0 over Time to Cool, such as when a player dies. Call it on the server. Every player sees it. \* \*\*StopCooling\*\*: Stops cooling and keeps the current heat. Call it on the server. !\[BP\\\_ThermalBodyExample starts cooling on the server when a projectile hits it\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-3e036f67d42ea3f3625ef91847ac813b528a7395%2Fstart-cooling.png?alt=media) --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgobjecttemperaturecomponent.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgrangefindercomponent.md). # SKGRangeFinderComponent This component is optional. It measures the distance to whatever it's pointed at and can show it on a Text Render component, such as a handheld or weapon mounted range finder. Add one to the range finder actor. The component finds its parts on the same actor by name: \* \*\*Mesh\*\*: The range finder's mesh, with a socket the range is measured from. The range is measured along the socket's X axis, so point it where the range finder aims. \* \*\*Text Render\*\*: Optional. Shows the range, such as on the range finder's screen. The range stops at anything that blocks the Range Finder Collision Channel in \[Developer Settings\](/skgsfdocs/getting-started/developer-settings.md). It ignores the range finder, everything it's attached to up to the pawn holding it, and everything else attached to them such as the other attachments on the firearm. Ranging isn't replicated, so each player's machine measures for itself locally. Set everything on the component and leave the Data Asset field empty. Using data assets as templates is covered in \[Data Assets\](/skgsfdocs/getting-started/data-assets.md). ## Settings ### Initialize !\[The SKGRangeFinder component's Initialize settings\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-0c2f0966006aaf7b54812d83bbaead3737e43d97%2Finitialize.png?alt=media) \* \*\*Auto Initialize\*\*: Sets up the component on BeginPlay. Turn it off to call \`InitializeRangeFinderComponent\` yourself. \* \*\*Range Finder Mesh Name\*\*: Name of the range finder's mesh. StaticMesh by default. \* \*\*Range Finder Laser Socket Name\*\*: The socket on that mesh the range is measured from. S\\\_Laser by default. \* \*\*Text Render Component Name\*\*: Name of the Text Render component that shows the range. Leave as None if you don't want one. \* \*\*Gameplay Tags\*\*: Tags you can use to identify this component in your own logic. ### Settings !\[The SKGRangeFinder component's Range Finder Settings\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-b0b9058c5e9727e5b08c447b2b8f8a7c3efb79ee%2Fsettings.png?alt=media) \* \*\*Range Finder Settings Data Asset\*\*: Leave empty and use Range Finder Settings. #### Range Finder Settings \* \*\*Gameplay Tags\*\*: Added to the component's Gameplay Tags. \* \*\*Min Trace Distance\*\*: Anything closer than this reads 0. In cm like Max Trace Distance. \* \*\*Max Trace Distance\*\*: How far the range finder reaches in cm, 100000 (1 km) by default. Past this, it reads 0. \* \*\*Measurement Symbols\*\*: The text shown after the number for each unit: \*\*Meter Symbol\*\*, \*\*Yard Symbol\*\*, \*\*Inch Symbol\*\* and \*\*Centimeter Symbol\*\*. m, yd, in and cm by default, so 150 meters shows as 150m. \* \*\*Use in Yard Meter\*\* / \*\*Use Metric\*\*: Pick the unit together: \* Both on: meters. \* Only Use Metric on: centimeters. \* Only Use in Yard Meter on: yards. \* Both off: inches. \* \*\*Auto Range\*\*: Measures on its own every Auto Range Interval and updates the Text Render. Off only measures when you call \`GetRange\`. \* \*\*Auto Range Interval\*\*: Seconds between measurements. ## Functions ### Initialize \* \*\*InitializeRangeFinderComponent\*\*: Sets up the component from its settings. Called for you on BeginPlay with Auto Initialize on. \* \*\*InitializeRangeFinderComponentFromSettings\*\*: Sets up the component from the settings you pass in. ### Range \* \*\*GetRange\*\*: Measures now and returns the distance in the chosen unit, or 0 if nothing is in range. Also updates the Text Render and fires On Ranged. \* \*\*GetRangeAsString\*\*: Same as GetRange, but returns the text with its symbol, such as 152m. The text only shows whole numbers. ### Getters \* \*\*GetRangeFinderMesh\*\* / \*\*GetTextRenderComponent\*\*: The components found from the names in Initialize. ### Other \* \*\*GetRangeFinderComponent\*\*: Returns the SKGRangeFinderComponent on an actor. ## Events \* \*\*On Ranged\*\*: Each measurement, with the distance in the chosen unit, or 0 when nothing is in range. --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgrangefindercomponent.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/holding-other-items.md). # Holding other items The framework isn't only for firearms. Anything you hold with an \[SKGProceduralAnimComponent\](/skgsfdocs/components/skgproceduralanimcomponent.md) gets the procedural animation, such as sway, lag, deadzone, aiming and poses. This page goes over the example's BP\\\_Held\\\_Flashlight, a one handed flashlight with a light and laser. !\[Holding BP\\\_Held\\\_Flashlight with its light and laser on\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-05281718a776ecf41c795c7a8af6f8d405f62fb5%2Fheld.png?alt=media) ## How it differs from a firearm When the held item has no \[SKGFirearmComponent\](/skgsfdocs/components/skgfirearmcomponent.md), the \[SKGShooterPawnComponent\](/skgsfdocs/components/skgshooterpawncomponent.md) uses the item's own SKGProceduralAnim component for all of its settings, and its own \[SKGOffhandIKComponent\](/skgsfdocs/components/skgoffhandikcomponent.md) if it has one. You can even put a \[SKGProceduralAnimComponent\](/skgsfdocs/components/skgproceduralanimcomponent.md) on your pawn specifying your pawn mesh and have it apply directly to your hands. Anything that comes from the SKGFirearm component isn't used, such as attachments, firearm collision. The SKGShooterPawn component has getters such as \`GetCurrentLightLaserComponents\` which in this case is used to call the functions to turn the light and laser on and off. ## The Blueprint BP\\\_Held\\\_Flashlight is an Actor Blueprint with Replicates on and these components: \* The mesh. It has an S\\\_Aim socket for aiming placed the same way as on a sight. See \[Setting up a red dot\](/skgsfdocs/setup-guides/setting-up-a-red-dot.md). \* A \*\*SKGProceduralAnim\*\* component with Procedural Mesh Name set to the mesh. Procedural Aim Socket Names already holds S\\\_Aim. Its sway, lag, deadzone, aiming and pose settings all apply to the flashlight. \* The light and laser with an \*\*SKGLightLaser\*\* component, set up the same way as on a light and laser attachment. See \[Setting up a light and laser\](/skgsfdocs/setup-guides/setting-up-a-light-and-laser.md). !\[BP\\\_Held\\\_Flashlight's components\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-ed39cb6be8e45914c4c9dd7a21c7b6e70bb0ab42%2Fcomponents.png?alt=media) ## Holding it Hold it the same way as a firearm. Call \`SetHeldActor\` on the SKGShooterPawn component on the server, then attach the flashlight to the pawn's mesh at ik\\\_hand\\\_gun. See the Holding something section in \[Setting up a pawn\](/skgsfdocs/setup-guides/setting-up-a-pawn.md). Aiming works the same as a firearm too, lining S\\\_Aim up with the camera. !\[Aiming BP\\\_Held\\\_Flashlight\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-e5f173ed10f5b8365b34cef6eced6e64747eb120%2Faiming.png?alt=media) ## Turning the light and laser on and off \`GetCurrentLightLaserComponents\` on the SKGShooterPawn component returns the light laser components of what you're holding, either the firearm's from its attachments or the held item's own. The example flips between \`TurnLightOn\` and \`TurnLightOff\` on each of them for the light, and \`TurnLaserOn\` and \`TurnLaserOff\` for the laser. These can be called on the client, and every player sees the change. See \[SKGLightLaserComponent\](/skgsfdocs/components/skglightlasercomponent.md#functions) for its other functions and how to setup the component. !\[BP\\\_PlayerPawn toggling the laser and light on whatever it's holding\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-5952b5bdbfcbf04e238c4808dea156b42e703217%2Ftoggle-light-laser.png?alt=media) --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/holding-other-items.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-pawn.md). # Setting up a pawn This guide sets up a pawn function with the SKG Shooter Framework. It is not dependent on ACharacter. It works with Pawn and Character classes so it also works with the General Movement Component (GMC) or Mover. The example's BP\\\_PlayerPawn is a Character using the UE5 mannequin (SK\\\_Mannequin). There are four steps: the skeleton, the pawn Blueprint, input, and the animation blueprint, which has its own guide in \[Setting up the animation blueprint\](/skgsfdocs/setup-guides/setting-up-the-animation-blueprint.md). ## 1. Skeleton The skeleton needs the hand IK bones ik\\\_hand\\\_gun, ik\\\_hand\\\_r and ik\\\_hand\\\_l. The UE5 mannequin already has them. If you are using metahuman's, you will need to add these (simple process). ### Virtual bones The procedural animation moves virtual bones on the head instead of the real IK bones, so the lower body's locomotion can't pull on it. Open your skeleton, right-click the bone in the table, pick Add Virtual Bone, pick the target bone, and type the name. Unreal adds VB in front of it so typing ik\\\_hand\\\_gun\\\_parent ends up being VB ik\\\_hand\\\_gun\\\_parent which is correct. | Name | Right-click on | Target bone | | --------------------- | ------------------------ | -------------- | | ik\\\_hand\\\_gun\\\_parent | head | head | | ik\\\_hand\\\_gun\\\_ads | VB ik\\\_hand\\\_gun\\\_parent | head | | ik\\\_hand\\\_gun | VB ik\\\_hand\\\_gun\\\_parent | ik\\\_hand\\\_gun | | FirearmCollision | head | ik\\\_hand\\\_root | !\[SK\\\_Mannequin's virtual bones and S\\\_Camera under the head\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-3dac3ca3b3b8af85a62748d060ec80829bca149f%2Fvirtual-bones.png?alt=media) ### Camera socket Right-click head, pick Add Socket, and name it S\\\_Camera. That's the \[SKGShooterPawnComponent\](/skgsfdocs/components/skgshooterpawncomponent.md)'s default Camera Attached Socket. Move it to where you want the "eyes" to be. The example puts it just in front the middle of the head. Then rotate it so a camera attached to it faces forward and upright. On the UE5 mannequin, use Pitch 0, Yaw 90, Roll -90, which the socket's Relative Rotation shows as -90, 0, 90. !\[S\\\_Camera on SK\\\_Mannequin's head\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-51e5d104a8be53978ef298e3bbc6271e4b155927%2Fcamera-socket.png?alt=media) !\[S\\\_Camera's Relative Rotation on the UE5 mannequin\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-2b7ed0543d8de307a6b0dd00d353dfcedb02a76c%2Fcamera-socket-rotation.png?alt=media) ### Upper body blend mask The animation blueprint plays the procedural animation on the upper body only using a blend mask. The example's is UpperBodyLowerBodySplitMask. 1. Click the gear icon above the skeleton tree, pick Blend Profiles > Add Blend Mask, and name it. Existing blend masks are listed in the same menu, so pick one there to edit it later. !\[The gear icon's Blend Profiles menu, with UpperBodyLowerBodySplitMask selected for editing\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-f90a1fe7bdd818417584f84f9ddde642b5f12663%2Fblend-mask-menu.png?alt=media) 2. Set ik\\\_hand\\\_root to 1, right-click it and pick Recursively Set Blend Scales To 1. Do the same for spine\\\_01. The legs and everything else stay at 0. 3. Lower the spine so the upper body blends in gradually. The example uses pelvis 0.1, spine\\\_01 0.25, spine\\\_02 0.3, spine\\\_03 0.4, spine\\\_04 0.5, spine\\\_05 0.6, and 0.75 on both clavicles. The arms, neck, head and virtual bones stay at 1. 4. Note that anytime you make a change to the blend mask, you should compile the animation blueprint using it (I have had issues in the past of it not updating and requiring a compile, granted that was in older engine versions so I recommend it). !\[UpperBodyLowerBodySplitMask: the IK bones and upper body at 1, the spine ramping up from the pelvis, and the legs at 0\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-b5650e1bac5f4cb2b7f97d8c0e7afd31e40ac1dd%2Fblend-mask.png?alt=media) ## 2. Pawn Blueprint 1. Set the mesh's Anim Class to your animation blueprint. 2. Add a CameraComponent (can be a Gameplay Camera), attach it to the mesh on S\\\_Camera, and turn on Use Pawn Control Rotation (unless you want leaning to rotate the camera). 3. Add an SKGShooterPawn component. Set its mesh and camera names to match your components. For one mesh, like the example, turn on Use Single Mesh. Every setting is on the \[SKGShooterPawnComponent\](/skgsfdocs/components/skgshooterpawncomponent.md) page. 4. For a Character, you can set the Character Movement's Component Class to \[SKGCharacterMovementComponent\](/skgsfdocs/components/skgcharactermovementcomponent.md) for sprinting. !\[BP\\\_PlayerPawn's components\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-267610a4288f2e6f37d3ce59d72be0a60be81394%2Fcomponents.png?alt=media) !\[BP\\\_PlayerPawn's Camera on S\\\_Camera with Use Pawn Control Rotation on\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-bb82e8b6c0be81567bc74347dd60b9da3ee0bb23%2Fcamera.png?alt=media) ## 3. Input The example's BP\\\_PlayerPawn uses Enhanced Input. Your input works like any other project's. You just pass some of it through the SKGShooterPawn component as well so the framework can handle the parts that depend on it such as deadzone, free look, and scaling look sensitivity to the zoom of a magnified optic. If you do not want to use these features, then you can ignore them and just add to your controllers pitch and yaw like normal. ### Look Look input is where most of this happens: 1. \*\*Magnified optics\*\*: While aiming, multiply the look input by \`GetMagnificationSensitivityMultiplier\`. Looking through a 4x scope would otherwise feel 4 times faster than normal, so this scales the sensitivity down to match the zoom. It also includes the optic's own Sensitivity Scale. 2. \*\*Free look\*\*: Add yaw only when \`CanAddYaw\` is true, and pitch only when \`CanAddPitch\` is true. They turn false when free look reaches its limits, so the view stops there. 3. \*\*Deadzone\*\*: Pass the look input to \`SetMouseInput\`. Deadzone uses it to let the firearm drift off center as you move the mouse, and free look uses it to check its limits. Run it on Triggered, Canceled and Completed, so the input goes back to 0 when the mouse stops. \`GetSensitivityMultiplier\` does steps 1 and 2 in one call if you prefer. !\[BP\\\_PlayerPawn's look input, with its own Mouse Sensitivity on top\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-685d175dc02dd42ef4e37e4eec0a3478021fa181%2Flook-input.png?alt=media) ### Aim, lean and free look These are just examples of how BP\\\_PlayerPawn uses them. Call these functions from whatever input or game logic suits your project, such as a toggle to aim instead of holding a button. #### Aim \`StartAiming\` on Started and \`StopAiming\` on Canceled and Completed. The example also stops sprinting and lowers the sway while aiming. !\[BP\\\_PlayerPawn's aim input\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-615b22a18ade040bf7c2b4db4b21286f33cbe15d%2Faim-input.png?alt=media) #### Lean \`Lean\` with the input's value on Triggered, such as -1 to 1 from two keys, and \`Lean\` with 0 on Canceled and Completed to stand back up. !\[BP\\\_PlayerPawn's lean input\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-3dd09042efec09c79caa530c74b855144c831806%2Flean-input.png?alt=media) #### Free look \`StartFreeLook\` on Started and \`StopFreeLook\` on Canceled and Completed. !\[BP\\\_PlayerPawn's free look input\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-4f2c17f0dacf880b762bc72a40560d8408a6fc0e%2Ffree-look-input.png?alt=media) ## 4. Holding something Call \`SetHeldActor\` on the SKGShooterPawn component on the server when the player picks up or equips something, such as a firearm, and \`ClearHeldActor\` when they drop it. \`SetHeldActor\` doesn't attach the actor to the pawn, so attach it to the mesh yourself. The example's OnPickupSet event sets the held actor, then attaches it to the mesh at the socket in its Firearm Attach Socket variable, ik\\\_hand\\\_gun. !\[BP\\\_PlayerPawn's OnPickupSet sets the held actor, then attaches it to the mesh\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-523d1259c1ca1322d79ea6d96fd7af99d9f2d3f4%2Fset-held-actor.png?alt=media) --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/setup-guides/setting-up-a-pawn.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent.md). # SKGProceduralAnimComponent Drives the procedural animation: aiming, sway, lag, deadzone, recoil and poses. Add one to everything you want to hold with procedural animation and to every attachment you can aim through such as an optic. This is not specific to firearms, it can be used to give life to holding a rock, box, firearm, sword, flashlight, etc. even your own characters hands for fists! \[Setting up a firearm\](/skgsfdocs/setup-guides/setting-up-a-firearm.md) and \[Setting up a red dot\](/skgsfdocs/setup-guides/setting-up-a-red-dot.md) show it set up on a firearm and an optic. Which settings are used depends on where the component is: \* \*\*On a firearm\*\*, or a held item without an \[SKGFirearmComponent\](/skgsfdocs/components/skgfirearmcomponent.md), every setting is used. \* \*\*On an attachment\*\* such as an optic, only Initialization Settings, Aiming Settings: Aiming Distance, Use Fixed Aiming Distance, Allow Camera Zoom and Can Aim are used. Everything else comes from the firearm. \* \*\*On the character\*\*, its settings are used while nothing is held. Set everything on the component and leave the Data Asset fields empty. Using data assets as templates is covered in \[Data Assets\](/skgsfdocs/getting-started/data-assets.md). ## Settings !\[BP\\\_BoltGun's SKGProceduralAnim Initialize settings, with a right-handed point aim socket\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-c1caab1545a2600abfb1ef4c9bf845d0ad11074b%2Fdetails-panel.png?alt=media) ### Initialize \* \*\*Auto Initialize\*\*: Sets up the component when it's created. If you turn this off, call \`InitializeProceduralAnimComponent\` yourself. \* \*\*Override Component Names\*\*: Only for setting the mesh name from C++. Leave off. \* \*\*Initialization Settings Data Asset\*\*: Leave empty and use Initialization Settings. #### Initialization Settings \* \*\*Procedural Mesh Name\*\*: Name of the mesh component that has the aim sockets, such as the firearm or optic mesh. \* \*\*Procedural Aim Socket Names\*\*: The aim sockets on that mesh. Most need one. An Elcan has two, one through the scope and one for the iron sights on top, and \`CycleAimSocket\` switches between them. \* \*\*Right Hand Dominate Point Aim Socket Name\*\* / \*\*Left Hand Dominate Point Aim Socket Name\*\*: The socket used for point aiming in right- or left-handed mode, such as a canted aim. Leave as None if you don't want point aiming. Usually only set on a firearm. \* \*\*Can Use Left Hand Dominate\*\*: Lets the player switch to left-handed mode while holding this. Needs left-handed animations. Only used on the firearm. \* \*\*Procedural Anim Gameplay Tag\*\*: Tells the animation what you're holding, so the anim graph can blend to the right idle pose, such as a different tag for an M4 and a SKS. Only used on the held item and is completely optional. \* \*\*Gameplay Tags\*\*: Tags you can use to identify this component in your own logic. !\[The S\\\_Aim socket on the holo sight, placed in the sight window\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-3a28d53d8a16498a12643d59549517b449423bfc%2Faim-socket.png?alt=media) ### Procedural Each group below has a Data Asset field above it. Leave it empty and set the values in the group. !\[The Procedural groups, each with its Data Asset field above it\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-3c3e6e48879e5a806e8220316ab8a3cc7f93729c%2Fprocedural-groups.png?alt=media) Curves use X forward, Y right, Z up for location, and X roll, Y pitch, Z yaw in degrees for rotation. They're mirrored for you in left-handed mode. Spring settings, used by several groups: \* \*\*Stiffness\*\*: How hard it pulls toward the target. \* \*\*Critical Damping Factor\*\*: How quickly the bounce settles. 1 settles with no overshoot, lower bounces more. \* \*\*Mass\*\*: Heavier feeling, slower response. \* \*\*Target Velocity Amount\*\*: How much of the target's movement carries into the spring. #### Aiming Settings \* \*\*Aiming Distance\*\*: How far in front of the camera you want the aim socket to be when aiming. On an optic, it's added to the firearm's Aiming Distance unless Use Fixed Aiming Distance is enabled. \* \*\*Aim Curves\*\*: Optional curves that add motion while aiming in and out. First Person Curve and Third Person Curve each have a Location Curve and Rotation Curve. Only used on the firearm. \* \*\*Aim Speed Curve\*\*: Optional curve for finer control of the aim in and out speed. The value is how far aimed in, from 0 to 1, and Default Aiming Speed scales the time. Only used on the firearm. \* \*\*Use Fixed Aiming Distance\*\*: On puts this aim socket exactly Aiming Distance from the camera always, so the firearm moves when the optic moves along the rail keeping the optic in place. Off keeps the firearm at the same distance no matter where the optic sits. \* \*\*Default Aiming Speed\*\*: How fast you aim in and out. Only used on the firearm. Attachments can change it through procedural stats on the \[SKGFirearmComponent\](/skgsfdocs/components/skgfirearmcomponent.md). \* \*\*Allow Camera Zoom\*\* / \*\*Camera Zoom Percentage\*\*: Zooms the camera in while aiming through this, by a percentage of the field of view. 10 narrows it by 10%. Magnified optics in Normal mode use their magnification instead. \* \*\*Can Aim\*\*: Off skips this aiming device when cycling. #### Procedural Offsets Only used on the held item such as a firearm. \* \*\*First Person Base Pose Offset\*\* / \*\*Third Person Base Pose Offset\*\*: Moves the held pose without changing the animation. Fixing the animation is usually the better choice and I personally recommend not using this except for testing. \* \*\*Third Person Right Handed Aiming Offset\*\* / \*\*Third Person Left Handed Aiming Offset\*\*: Offset while aiming, as seen in third person. Without it, the sight lines up with the camera in the middle of the head. #### Cycle Aiming Point Settings Only used on the held item such as a firearm. Used when switching aim points, such as to another optic, another aim socket, or point aiming. \* \*\*Use Spring Interp for Cycling Aiming Point\*\*: Springs to the new aim point with a little overshoot. Off moves there smoothly with no overshoot. \* \*\*Spring Interp Settings\*\*: Spring settings for location and rotation. #### Movement Sway Settings Only used on the held item such as a firearm. Idle breathing and walking sway. The curve plays at quarter speed while standing still and full speed at 250 cm/s in the example project. Its time keeps counting up, so set the curve's extrapolation to Cycle so it loops. \* \*\*Use Movement Sway\*\*: Turns movement sway on. \* \*\*Location Settings\*\* / \*\*Rotation Settings\*\*: Sway for location and rotation, each with: \* \*\*Multiplier\*\*: Scales the curve. \`SetSwayMultiplier\` on the \[SKGShooterPawnComponent\](/skgsfdocs/components/skgshooterpawncomponent.md) changes it at runtime. \* \*\*Multiplier Interpolation Rate\*\*: How quickly a new multiplier blends in. \* \*\*Curve\*\*: The sway curve. \* \*\*Interp Speed\*\*: How closely it follows the curve. Lower is smoother. #### Movement Lag Settings Only used on the held item such as a firearm. Tilts the firearm as you move, such as rolling it when strafing. !\[Movement Lag Settings, with the Aim rows under the hip ones\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-f1b63c918b0ee636869e04f24bb6326d021ebb7d%2Fmovement-lag-settings.png?alt=media) \* \*\*Use Movement Lag\*\*: Turns movement lag on. \* \*\*Disable Forward Movement Lag While Aiming\*\*: Stops the forward and backward tilt while aiming. \* \*\*Use Spring Interpolation\*\*: On uses Spring Interp Settings, a spring for pitch, roll and yaw. Off uses Interp Settings, a speed for each. \* \*\*Aim Spring Interp Settings\*\* / \*\*Aim Interp Settings\*\*: The same settings, used while aiming. They blend in as you aim. \* \*\*Remote Interp Settings\*\*: The speed used to show other players' movement lag. \* \*\*Forward Backward Normalized Max\*\* / \*\*Left Right Normalized Max\*\* / \*\*Up Down Normalized Max\*\*: Movement speed is divided by these, in cm/s. Lower values tilt more at the same speed. \* \*\*Forward Multiplier\*\* / \*\*Backward Multiplier\*\*: Scales the tilt when moving forward or backward. Negative inverts it. \* \*\*Multiplier\*\*: Scales the pitch, yaw and roll tilt. \* \*\*Axis Routing\*\*: Which rotations each movement direction drives. By default, forward, backward, up and down drive pitch, and left and right drive roll and yaw. #### Rotation Lag Settings Only used on the held item such as a firearm. The firearm trails behind (or ahead based on settings) as you turn the camera. !\[Rotation Lag Settings, with the Aim rows under the hip ones\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-7b3c1e06c689dc41012b86140d8e629c2aaa2929%2Frotation-lag-settings.png?alt=media) \* \*\*Use Rotation Lag\*\*: Turns rotation lag on. \* \*\*Use Spring Interpolation\*\*: On uses Spring Interp Settings, a spring for each rotation and location axis. Off uses Interp Settings, a speed for each. Springs only run for the local player. \* \*\*Aim Spring Interp Settings\*\* / \*\*Aim Interp Settings\*\*: The same settings, used while aiming. They blend in as you aim. \* \*\*Remote Interp Settings\*\*: The rotation and location speeds used to show other players' rotation lag. \* \*\*Max Rotation\*\* / \*\*Max Location\*\*: The furthest it can lag, in degrees and cm. \* \*\*Rotation Multiplier\*\* / \*\*Location Multiplier\*\*: How much turning moves it. Higher lags more. \* \*\*Axis Routing\*\*: Whether each rotation and location axis follows left and right or up and down mouse movement. #### Deadzone Settings Only used on the held item such as a firearm. Lets the firearm drift off center as you move the mouse, up to a limit, like free aim. Local player only. \* \*\*Use Deadzone\*\*: Turns deadzone on. \* \*\*Pitch Rate\*\* / \*\*Yaw Rate\*\*: How far mouse movement moves the firearm. \* \*\*Pitch Limit\*\* / \*\*Yaw Limit\*\*: The furthest it can drift, in degrees. \* \*\*Interpolation Speed\*\*: How smoothly it moves. Lower is smoother. \* \*\*Disable Deadzone when Aiming\*\* / \*\*Deadzone Aiming Disable Interpolation Speed\*\*: Recenters the firearm while aiming, at that speed. \* \*\*Always Interpolate Back to Center\*\* / \*\*Interpolate Back to Center Speed\*\*: Drifts back to center all the time, at that speed. #### Recoil Settings Plays each time \`PerformProceduralRecoil\` is called on the \[SKGShooterPawnComponent\](/skgsfdocs/components/skgshooterpawncomponent.md). Each curve has random ranges that multiply it every shot, so no two shots look the same. A Roll Random of -12 to 12 rolls the firearm a random direction by a random amount each shot. \* \*\*Control Rotation Curve\*\* / \*\*Control Pitch Random\*\* / \*\*Control Yaw Random\*\* / \*\*Control Roll Random\*\*: Kicks the camera. Local player only. \* \*\*Location Curve\*\* / \*\*XRandom\*\* / \*\*YRandom\*\* / \*\*ZRandom\*\*: Moves the firearm. \* \*\*Location Interp to None Speed\*\*: How fast the firearm moves back after a shot. \* \*\*Rotation Curve\*\* / \*\*Pitch Random\*\* / \*\*Yaw Random\*\* / \*\*Roll Random\*\*: Rotates the firearm. \* \*\*Rotation Interp to None Speed\*\*: How fast the firearm and camera roll rotate back after a shot. #### Pose Settings Only used on the held item such as a firearm. Poses such as high ready or low ready, played with \`PerformProceduralPose\` on the \[SKGShooterPawnComponent\](/skgsfdocs/components/skgshooterpawncomponent.md). See \[Creating a custom pose\](/skgsfdocs/setup-guides/creating-a-custom-pose.md). \* \*\*To Curve\*\* / \*\*From Curve\*\*: The curves for entering and leaving the pose, each with a first and third person version. Every curve has a Location Curve, Rotation Curve and Play Rate. \* \*\*Curve Tag\*\*: The tag you pass to \`PerformProceduralPose\`, such as Poses.HighPort. \* \*\*Interpolate\*\* / \*\*Interpolation Speed\*\*: Blends toward the curve instead of following it exactly, at that speed. Smooths switching poses partway through. \* \*\*Interpolation Speed Multiplier\*\*: Used when you leave or re-enter a pose before it finishes. Higher starts the other curve closer to its beginning. \* \*\*Interpolate Constant\*\*: Blends at a fixed rate instead of easing in. \* \*\*Interpolation Time\*\*: How long the blending lasts, in seconds. After that the pose follows the curve exactly. ## Functions ### Initialize \* \*\*InitializeProceduralAnimComponent\*\*: Sets up the component from its settings. Called for you when Auto Initialize is on. \* \*\*InitializeProceduralAnimComponentFromSettings\*\*: Sets up the component from the settings you pass in. \* \*\*SetProceduralAnimSettings\*\*: Replaces every Procedural group at once. Only changes this machine. ### Aim \* \*\*CanAim\*\* / \*\*SetCanAim\*\*: Gets or sets Can Aim. \* \*\*GetProceduralAimingSettings\*\*: Returns the Aiming Settings. \* \*\*GetAimWorldTransform\*\*: World transform of the current aim socket. \* \*\*GetAimSocketIndex\*\*: Index of the current aim socket in Procedural Aim Socket Names. \* \*\*CycleAimSocket\*\*: Switches to the next aim socket, such as from the Elcan's scope to its iron sights. Returns true if it changed. \* \*\*StartPointAiming\*\* / \*\*StopPointAiming\*\*: Switches to and from the point aim socket. Use the versions on the \[SKGFirearmComponent\](/skgsfdocs/components/skgfirearmcomponent.md). \* \*\*UpdateAimOffset\*\* / \*\*UpdateAimOffsetWithSocket\*\*: Recalculates the aim offset. The SKGShooterPawnComponent and SKGFirearmComponent call these for you. ### Muzzle \* \*\*GetAimMuzzleTransform\*\*: The aim socket's transform turned to the mesh's forward axis, for your own muzzle zeroing. Can be overridden in a Blueprint child of this component. ### Pose \* \*\*GetPose\*\*: Finds a pose in Pose Settings by its Curve Tag. Returns true if found. ### Data Assets Swaps a group's settings for a data asset at runtime, such as heavier sway while injured. Call these on the server. The change replicates. \* \*\*SetAimingSettings\*\* / \*\*SetProceduralOffsets\*\* / \*\*SetCycleAimingPointSettings\*\* / \*\*SetMovementSwaySettings\*\* / \*\*SetMovementLagSettings\*\* / \*\*SetRotationLagSettings\*\* / \*\*SetDeadzoneSettings\*\* / \*\*SetRecoilSettings\*\* / \*\*SetProceduralPoseSettings\*\*: Use the data asset for that group. \* \*\*RevertAimingSettings\*\* / \*\*RevertProceduralOffsetsSettings\*\* / \*\*RevertCycleAimingPointSettings\*\* / \*\*RevertMovementSwaySettings\*\* / \*\*RevertMovementLagSettings\*\* / \*\*RevertRotationLagSettings\*\* / \*\*RevertDeadzoneSettings\*\* / \*\*RevertRecoilSettings\*\* / \*\*RevertProceduralPoseSettings\*\*: Go back to the settings the group started with. \* \*\*RevertAllSettingsToDefault\*\*: Reverts every group. ### Getters \* \*\*GetAimOffset\*\*: The current aim socket's offset, used by the animation. \* \*\*GetProceduralAnimMesh\*\*: The mesh from Procedural Mesh Name. \* \*\*CanUseLeftHandDominate\*\*: Returns Can Use Left Hand Dominate. ### Other \* \*\*GetProceduralAnimComponent\*\*: Returns the SKGProceduralAnimComponent on an actor. ## Events \* \*\*On Can Aim Changed\*\*: After SetCanAim changes Can Aim. Local only. \* \*\*On Point Aim State Changed\*\*: When point aiming starts or stops. Local only. \* \*\*On Aim Socket Cycled\*\*: After CycleAimSocket switches sockets. Local only. \* \*\*On Aim Socket Cycled Replicated\*\*: When an aim socket change arrives from another machine. Use it to update what other players see. \* \*\*On Procedural Data Assets Changed\*\*: After a data asset is swapped or reverted. The SKGFirearmComponent uses it to pick up the new settings. --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgproceduralanimcomponent.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentcomponent.md). # SKGAttachmentComponent This component is optional. You can use your own attachment system instead and call \`AddAttachment\` and \`RemoveAttachment\` on the \[SKGFirearmComponent\](/skgsfdocs/components/skgfirearmcomponent.md) whenever an attachment is added or removed. A slot that holds one attachment, such as the optic slot on a rifle or the handguard slot on an upper receiver. Add one for each attachment point on your Blueprint. It spawns, attaches and replicates the attachment, controls which attachments are allowed, and can slide the attachment along a rail. See \[Setting up attachments\](/skgsfdocs/setup-guides/setting-up-attachments.md) for a step by step setup. Attachment components register with the \[SKGAttachmentManagerComponent\](/skgsfdocs/components/skgattachmentmanagercomponent.md) on the same actor or any actor it's attached to, such as the firearm. !\[The M4's optic slot in the Details panel\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-a8af6492cebee2bd1e1a77543e12afce66487d40%2Fdetails-panel.png?alt=media) ## Settings ### Initialize \* \*\*Attach to Mesh Name\*\*: Name of the mesh component the attachment attaches to. \* \*\*Attach to Socket\*\*: Socket on that mesh the attachment attaches to. \* \*\*Component Name\*\*: Optional name for this slot, such as Sights. Useful for customization menus. \* \*\*Component Image\*\*: Optional icon for this slot. Useful for customization menus. \* \*\*Auto Call Force Net Update\*\*: Forces a network update whenever the attachment or offset changes. Useful if the actor's Net Update Frequency is very low. \* \*\*Gameplay Tags\*\*: Tags you can use to identify this slot in your own logic. !\[The S\\\_Attachment\\\_Optic socket on the M4, used by its optic slot\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-026c5ad2ce42a3ac2829ddac6ae94c2b38d6c567%2Fattach-to-socket.png?alt=media) ### Attachment \* \*\*Is Required to Function\*\*: Marks the slot as essential, such as a barrel or handguard. The example's customization menu uses this to stop these from being removed. \* \*\*Auto Set Leader Pose Component\*\*: For attaching skeletal meshes to a character, such as clothing. The attachment's mesh follows the character's animation. \* \*\*Leader Pose Attachment Mesh Name\*\*: Name of the skeletal mesh on the attachment that follows the character. \* \*\*Random Default Attachment\*\*: Spawns a random compatible attachment at start instead of Default Attachment. Uses Compatible Attachments. \* \*\*Default Attachment\*\*: The attachment spawned at start. Only spawns if an SKGAttachmentManagerComponent is found. #### Compatibility Controls which attachments this slot accepts. There are two ways to do it. \* \*\*Use Legacy Attachment System\*\*: On uses Compatible Attachments. Off uses gameplay tags. \* \*\*Compatible Attachments\*\*: Data assets that list the allowed attachment classes. Leave empty to allow any attachment. \* \*\*Slot Tag\*\*: Gameplay tag compatibility. The tag for this slot, looked up in the Slot Compatibility Table List in the attachment developer settings. Attachments whose gameplay tags match that slot's query are allowed. \* \*\*Slot Compatibility Override\*\*: Used when Slot Tag is empty. Sets the slot tag and query directly on this component. Gameplay tag compatibility needs attachments that have gameplay tags, such as Blueprints based on SKGBaseActor or its child classes. See \[Gameplay tag attachment compatibility\](/skgsfdocs/setup-guides/gameplay-tag-attachment-compatibility.md). !\[A compatibility data asset listing the attachments allowed in the M4's optic slot\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-662ec4b5693a4acea63d25cebb6aeaef599a62a7%2Fcompatible-attachments.png?alt=media) #### Settings \* \*\*Allow Client Side Modification\*\*: Lets clients add, remove and move attachments. If off, only the server can, and a client that tries anyway is disconnected. \*\*Offset Settings\*\* Lets the attachment slide along a rail, along the mesh's forward axis. \* \*\*Use Offset System\*\*: Turn off if this slot never moves its attachment such as a barrel. \* \*\*Replicate Offset Each Change\*\*: Replicates every offset change. If off, you must call \`FinalizeAttachmentOffset\` when the player is done moving the attachment in order for it to replicate. \* \*\*Offset Snap Distance\*\*: Spacing between rail slots, in cm. 1.046 for Picatinny, 4.0 for M-LOK, 2.0 for KeyMod. \* \*\*Minimum Offset Allowed\*\* / \*\*Maximum Offset Allowed\*\*: How far the attachment can move back and forward from the socket, in cm. Rounded to the snap distance. \* \*\*Default Attachment Offset\*\*: Where the attachment starts. \*\*Attachment Rules\*\* How the attachment is attached to the socket. The defaults work for most attachments. \* \*\*Attach Location Rule\*\* / \*\*Attach Rotation Rule\*\* / \*\*Attach Scale Rule\*\*: Same as Unreal's attachment rules. \* \*\*Weld Simulated Bodies\*\*: Same as Unreal's Weld Simulated Bodies. ## Functions Changes made on a client are sent to the server when Allow Client Side Modification is on. ### Attachment \* \*\*TryLoadSetupAttachment\*\*: Loads the attachment class in the background, then spawns and attaches it. \* \*\*TrySetupAttachment\*\*: Spawns and attaches the attachment class. \* \*\*TrySetupExistingAttachment\*\*: Sets up an actor that already exists as the attachment in the slot with an optional attach. \* \*\*TryLoadSetupAttachmentWithData\*\* / \*\*TrySetupAttachmentWithData\*\*: Same as above, but builds the attachment from a data asset. See \[Data Assets\](/skgsfdocs/getting-started/data-assets.md). \* \*\*RemoveAttachment\*\*: Removes the attachment from the slot without destroying it, such as when dropping it or moving it to an inventory. Returns the removed attachment. \* \*\*DestroyAttachment\*\*: Removes and destroys the attachment, along with anything attached to it. \* \*\*HasAttachment\*\*: True if the slot has an attachment. Remove or destroy the current attachment before setting up a new one. ### Compatibility \* \*\*IsAttachmentClassCompatible\*\* / \*\*IsAttachmentCompatible\*\*: True if the class or object is allowed in this slot. Both can be overridden in Blueprint. \* \*\*GetCompatibleAttachments\*\*: The attachment classes from Compatible Attachments. \* \*\*GetCompatibleAttachmentsFromPrimaryAssets\*\*: Every data asset allowed by gameplay tag compatibility, from the Asset Types in the attachment developer settings. \* \*\*GetUsesLegacyAttachmentCompatibilitySystem\*\*: True if Use Legacy Attachment System is on. ### Preview Shows an attachment only on the local machine, such as when hovering over it in a customization menu. The current attachment is hidden while a preview is shown. \* \*\*TryLoadSetupPreviewAttachment\*\* / \*\*SetupPreviewAttachment\*\*: Shows a preview of the attachment class. \* \*\*TryLoadSetupPreviewAttachmentWithData\*\* / \*\*SetupPreviewAttachmentWithData\*\*: Shows a preview built from a data asset. \* \*\*DestroyPreviewAttachment\*\*: Removes the preview and shows the current attachment again. ### Offset \* \*\*SetAttachmentOffset\*\*: Moves the attachment to an offset, snapped and clamped to the Offset Settings. \* \*\*IncrementOffset\*\* / \*\*DecrementOffset\*\*: Moves the attachment forward or back one rail slot. \* \*\*FinalizeAttachmentOffset\*\*: Replicates the current offset. Needed when Replicate Offset Each Change is off. \* \*\*CanAttachmentBeOffset\*\*: True if the minimum and maximum offset are different. \* \*\*GetAttachTransform\*\*: World transform of the socket. \* \*\*GetAttachOffsetTransform\*\*: World transform of the socket with the current offset applied. \* \*\*GetAttachStartTransform\*\* / \*\*GetAttachEndTransform\*\*: World transform at the minimum and maximum offset. \* \*\*GetAttachSnapPoints\*\*: World locations of every rail slot between the minimum and maximum offset. ### Getters \* \*\*GetAttachment\*\*: The current attachment. \* \*\*GetAttachmentOffset\*\*: The current offset. \* \*\*GetAttachToSocket\*\* / \*\*GetComponentName\*\* / \*\*GetComponentImage\*\* / \*\*GetDefaultAttachment\*\* / \*\*GetIsRequiredToFunction\*\* / \*\*GetOffsetSettings\*\*: Return the matching setting. ## Events \* \*\*On Attachment Added\*\* / \*\*On Attachment Removed\*\*: When an attachment is added or removed. Fires on the server and clients. \* \*\*On Attachment Changed\*\*: Any time an attachment is added or removed. Fires on the server and clients. \* \*\*On Attachment Destroyed\*\*: Right before the attachment is destroyed. Server only. \* \*\*On Offset Changed\*\*: When the offset changes. Fires on the server and clients. \* \*\*On Preview Attachment Added\*\* / \*\*On Preview Attachment Removed\*\*: When a preview is shown or removed. Local only. --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgattachmentcomponent.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgnightvisioncomponent.md). # SKGNightVisionComponent This component is optional. It runs a night vision device, such as helmet mounted goggles or a clip-on in front of an optic. It sets up the night vision post process materials, the lens, the gain, tube burn-in and an optional infrared illuminator. Add one to the night vision actor, such as the example's BP\\\_NightVision, or directly to your pawn. See \[Setting up night vision\](/skgsfdocs/setup-guides/setting-up-night-vision.md) for a step by step setup. The component doesn't show the night vision on screen by itself. To use it: 1. For the local player only, add the two night vision materials to a Post Process component as blendables with a weight of 0. Get them from \`GetNightVisionMaterialPair\`, or from \`CreateAndSetupDynamicNightVisionMaterialInstance\` like the example. 2. When the player turns night vision on, call \`TurnTubesOn\` on the SKGNightVisionComponent and set the blendables' weight to 1. Call \`TurnTubesOff\` and set it back to 0 when it's turned off. 3. Also call \`EnableInfraredMode\` on the SKG Infrared World Subsystem for the local player when night vision turns on, and \`DisableInfraredMode\` when it turns off. Infrared lights and lasers only show while it's on, and magnified optics only show the night vision image through the tubes while it's on. !\[BP\\\_NightVision adds both night vision materials to its PP Night Vision component with a weight of 0, only for the local player\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-a2325c1a531bf7b268a12eaa03d60665e98d18e7%2Fblendables.png?alt=media) Set everything on the component and leave the Data Asset fields empty. Using data assets as templates is covered in \[Data Assets\](/skgsfdocs/getting-started/data-assets.md). ## Settings !\[BP\\\_NightVision's SKGNightVision component with Tube Settings expanded\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-992bd9ca4865f25e0d3120d6cdb1092bc0fa68e9%2Ftube-settings.png?alt=media) \* \*\*Burn in Render Target\*\* / \*\*IRLight Mask Render Target\*\*: Read only. The textures made while playing for burn-in and the IR light mask. ### Initialize \* \*\*Auto Initialize\*\*: Sets up the component on BeginPlay. Turn it off to call \`InitializeNightVisionComponent\` yourself. ### Settings \* \*\*Tube Settings Data Asset\*\* / \*\*Housing Settings Data Asset\*\*: Leave empty and use Tube Settings and Housing Settings. #### Tube Settings The tubes: how the image looks. \* \*\*Night Vision Material\*\* / \*\*Night Vision Scintillation Material\*\*: The post process materials for the night vision image and its grain. Use PPM\\\_NightVision and PPM\\\_NVScintillation from SKGSFCore/Materials/PostProcess/NightVision. \* \*\*Tubes on by Default\*\*: Starts with the tubes on, the same as calling \`TurnTubesOn\` on BeginPlay. Off in the example. \* \*\*Color\*\*: The phosphor color, such as green or white phosphor. \* \*\*Gain\*\*: The starting gain, or brightness boost. 250 in the example. \* \*\*Contrast\*\*: Contrast of the image. \* \*\*Max Gain\*\*: The gain at full, when \`SetGain\` is 1. \* \*\*Signal to Noise Ratio\*\*: Higher gives a cleaner image with less noise. 5 in the example. \* \*\*Noise Factor\*\* / \*\*Grain Multiplier\*\*: How much grain the image has. \* \*\*Burn in Render Target Size\*\*: Size of the burn-in texture, 1024 in the example. Bright lights streak and can burn into the tubes. 0 turns burn-in off. \* \*\*Minimum Luminance for Burn In\*\*: Light brighter than this starts to streak and burn in. \* \*\*Burn in Permanent Threshold\*\*: Burn-in this strong never heals. Above 1 means it always heals. \* \*\*Burn in Rate Value A\*\* / \*\*B\*\* / \*\*C\*\*: Shape how fast burn-in grows the brighter the light: A × B^x + C. \* \*\*Burn in Scale\*\*: Lower burns in slower. \* \*\*Burn in Healing Rate\*\*: Higher heals streaks faster. \* \*\*IRLight Mask Render Target Size\*\*: Size of the mask that keeps infrared lights inside the night vision lens, 512 in the example. 0 skips it. Mesh Visual Type only. #### Housing Settings The housing: the lens, gain controls and illuminator. !\[BP\\\_NightVision's Housing Settings\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-7fd6fbb03f01fb0abd64b0abd7ec0ae10ef913f0%2Fhousing-settings.png?alt=media) \* \*\*Visual Type\*\*: How the night vision is seen: \* \*\*Mesh\*\*: Through a lens mesh in front of the camera, like the example's dual tube goggles. \* \*\*Overlay\*\*: Through a texture mask on the screen, set in Overlay Mask, such as T\\\_NightVisionDualTubeMask or T\\\_NightVisionPanoMask. \* \*\*Fullscreen\*\*: Over the whole screen. \* \*\*Manual Gain\*\*: Lets the player change the gain with \`SetGain\`, \`IncreaseGain\` and \`DecreaseGain\`. \* \*\*Smooth Adjust Gain\*\* / \*\*Smooth Adjust Speed\*\*: Changes the gain gradually at this speed instead of all at once. On in the example. \* \*\*Gain Adjustment Step Amount\*\*: How much \`IncreaseGain\` and \`DecreaseGain\` change the gain, from 0 to 1. 0.1 is 10% of Max Gain. \* \*\*Minimum Gain\*\*: The lowest the gain can go, from 0 to 1. \* \*\*Lens Mesh Name\*\*: Name of the lens mesh, Tube in the example. Mesh Visual Type only. Its material must support the night vision lens, such as MI\\\_NVG\\\_DualTube. \* \*\*Eyebox Center Locations\*\*: Sockets on the lens mesh at the center of each tube. 1 for a monocular such as a PVS-14, 2 for dual tubes (S\\\_EyeboxLeft and S\\\_EyeboxRight in the example), or 4 for panoramic such as GPNVGs. Any other count is skipped with an error in the log. \* \*\*Distortion Radius\*\* / \*\*Distortion Hardness\*\* / \*\*Use Radial Distortion\*\*: Distortion around the edge of each tube. \* \*\*Lens Stencil Value\*\*: Custom stencil value written to the lens mesh, used by the IR light mask. Pick a value nothing else in your project uses. 25 by default. The night vision materials read NightVisionStencilValue in MPC\\\_SKGSF instead, so if you change this, change that to the same value. \* \*\*Illuminator Light Component Tag\*\*: Component tag on the light used as the device's infrared illuminator, Illuminator in the example. Leave as None if it has none. \* \*\*Infrared Light Function Material\*\*: The light function for the illuminator, so it only shows through night vision. Use M\\\_IRLightFunction from SKGSFCore. \* \*\*Illuminator Brightness Settings\*\*: The brightness levels \`CycleIlluminatorBrightness\` steps through, such as 0.25, 2 and 5 in the example. The first is the starting brightness. ## Functions Only the illuminator is sent to other players. The tubes and gain only change on the machine that calls them. ### Initialize \* \*\*InitializeNightVisionComponent\*\*: Sets up the component from its settings. Called for you on BeginPlay with Auto Initialize on. \* \*\*InitializeNightVisionComponentFromSettings\*\*: Sets up the component from the settings you pass in. \* \*\*SetTubeAndHousingSettings\*\* / \*\*SetTubeAndHousingSettingsFromStructs\*\*: Replaces the settings with the data assets or settings you pass in, such as when switching tubes. Call \`CreateAndSetupDynamicNightVisionMaterialInstance\` and \`SetupIlluminator\` afterward to apply them. \* \*\*GetTubeSettings\*\* / \*\*GetHousingSettings\*\*: The current settings. ### Materials \* \*\*CreateAndSetupDynamicNightVisionMaterialInstance\*\*: Makes the dynamic night vision and scintillation materials from the settings and returns them. Called during initialize. \* \*\*GetNightVisionMaterialPair\*\*: The two dynamic materials. Add both to a post process as blendables. \* \*\*SetupIlluminator\*\*: Finds the illuminator light from Illuminator Light Component Tag. Called during initialize. ### Tubes \* \*\*TurnTubesOn\*\* / \*\*TurnTubesOff\*\*: Turns the tubes on or off and fires On Tubes On State Changed. Turning them on starts burn-in and the IR light mask. It doesn't show or hide the image, you need to do that yourself. \* \*\*AreTubesOn\*\*: True while the tubes are on. ### Gain Needs Manual Gain. \* \*\*SetGain\*\*: Sets the gain from 0 to 1 as a fraction of Max Gain. It won't go below Minimum Gain. \* \*\*IncreaseGain\*\* / \*\*DecreaseGain\*\*: Changes the gain by Gain Adjustment Step Amount. ### Illuminator Can be called on the client. The change is sent to the server and every player sees it. \* \*\*TurnIlluminatorOn\*\* / \*\*TurnIlluminatorOff\*\* / \*\*SetIlluminatorState\*\*: Turns the illuminator on or off. \* \*\*IsIlluminatorOn\*\*: True while the illuminator is on. \* \*\*CycleIlluminatorBrightness\*\*: Steps to the next level in Illuminator Brightness Settings. \* \*\*SetIlluminatorBrightness\*\*: Sets the illuminator's brightness directly. ### Burn In and IR Light Mask \* \*\*IsBurnInAllowed\*\*: True if Burn in Render Target Size is above 0. \* \*\*GetBurnInRenderTarget\*\* / \*\*GetIRLightMaskRenderTarget\*\*: The burn-in texture and the IR light mask. ## Events \* \*\*On Tubes On State Changed\*\*: When the tubes turn on or off. Show or hide the night vision here. --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgnightvisioncomponent.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgoffhandikcomponent.md). # SKGOffhandIKComponent This component is optional. You can just use a normal animation in its place and bypass its section in the provided anim layer. This component places the offhand on what you're holding and sets the offhand's grip pose. The offhand is the left hand when right-handed and the right hand when left-handed. Add one to the firearm and to every attachment the offhand can hold, such as a handguard or forward grip if you wish to use the system. See \[Setting up a handguard and forward grip\](/skgsfdocs/setup-guides/setting-up-a-handguard-and-forward-grip.md) for a step by step setup. A montage can turn the offhand IK off for a while, such as to grab a magazine during a reload, with the OffhandIKCurveAlpha curve covered in \[Performing animations\](/skgsfdocs/setup-guides/performing-animations.md). The \[SKGFirearmComponent\](/skgsfdocs/components/skgfirearmcomponent.md) picks which one the offhand uses by its Offhand IKTag: a forward grip first, then a handguard, then the firearm. Remove the forward grip and the hand moves to the handguard. When holding something without an SKGFirearmComponent, the one on that item is used. Set everything on the component and leave the Data Asset fields empty. Using data assets as templates is covered in \[Data Assets\](/skgsfdocs/getting-started/data-assets.md). ## Settings !\[BP\\\_Foregrip\\\_AFG's SKGOffhandIK settings, tagged as a forward grip with the AFG grip pose\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-14936dfcddc34dad02da1e0a743caaef8c473c8c%2Fdetails-panel.png?alt=media) ### Initialize \* \*\*Auto Initialize\*\*: Sets up the component when it's created. If you turn this off, call \`InitializeOffhandIKComponent\` yourself. \* \*\*Override Component Names\*\*: Only for setting the mesh name from C++. Leave off. \* \*\*Initialization Settings Data Asset\*\*: Leave empty and use Initialization Settings. \* \*\*Gameplay Tags\*\*: Tags you can use to identify this component in your own logic. #### Initialization Settings \* \*\*Offhand IKTag\*\*: Firearm, Handguard or Forward Grip. Decides which component the offhand uses when there's more than one. \* \*\*Offhand IKMesh Name\*\*: Name of the mesh component that has the hand sockets, such as the handguard or forward grip mesh. \* \*\*Left Hand IKSocket Name\*\*: Where the left hand goes when right-handed. \* \*\*Right Hand IKSocket Name\*\*: Where the right hand goes when left-handed. Only needed if the firearm has Can Use Left Hand Dominate on its \[SKGProceduralAnimComponent\](/skgsfdocs/components/skgproceduralanimcomponent.md). The socket is where the hand bone goes, not the palm, so place it where the wrist should be when holding the grip. !\[The S\\\_LeftHandIK socket on the AFG, off to the side where the hand bone sits\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-00e64b0a2377ce4efb2436a9520871f569c6598f%2Fhand-socket.png?alt=media) ### Settings \* \*\*Offhand IKSettings Data Asset\*\*: Leave empty and use Offhand IKSettings. #### Offhand IKSettings \* \*\*Left Hand IKPose\*\* / \*\*Right Hand IKPose\*\*: The grip pose for the offhand, such as a different hand pose for a vertical grip and an angled grip. Left Hand IKPose is used when right-handed. ## Functions ### Initialize \* \*\*InitializeOffhandIKComponent\*\*: Sets up the component from its settings. Called for you when Auto Initialize is on. \* \*\*InitializeOffhandIKComponentFromSettings\*\*: Sets up the component from the settings you pass in. ### Offhand IK \* \*\*UpdateOffhandIK\*\*: Works out where the hand socket is relative to the component you pass in, and picks the left or right hand pose. The \[SKGFirearmComponent\](/skgsfdocs/components/skgfirearmcomponent.md) and \[SKGShooterPawnComponent\](/skgsfdocs/components/skgshooterpawncomponent.md) call it for you. ### Getters \* \*\*GetOffhandIKOffset\*\*: The hand socket's offset from the last UpdateOffhandIK, used by the animation. \* \*\*GetOffhandIKPose\*\*: The pose picked by the last UpdateOffhandIK. \* \*\*GetOffhandIKMesh\*\*: The mesh from Offhand IKMesh Name. ### Other \* \*\*GetOffhandIKComponent\*\*: Returns the SKGOffhandIKComponent on an actor. --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/components/skgoffhandikcomponent.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://sneakykittygamedev.gitbook.io/skgsfdocs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/projectiles.md). # Projectiles The projectile system is optional. It fires simple bullets that drop with gravity, slow down with drag and drift with wind, without spawning an actor for each one. Each bullet stops at the first thing it hits, with no penetration or ricochet. It's good for getting started and testing. For realistic bullets, I recommend the \[Terminal Ballistics\](https://www.fab.com/listings/c13b65e3-5a9e-4f6e-b607-5313eaff541d) plugin. Bullets are run by the SKGProjectileWorldSubsystem and set up with a Projectile Definition data asset. Make one from right-click > SKG > Data Assets > Projectile > Projectile Definition in the Content Browser. The example's DA\\\_556 in SKGSFExampleContent/Data/Projectiles is a 5.56 round. Bullets aren't replicated, they are designed to be simulated locally. They move in fixed steps of 1/120 of a second whatever the frame rate, so a bullet follows the same path on every machine. ## Firing a bullet Call \`FireProjectile\` on the SKGProjectileWorldSubsystem with the Projectile Definition and the \[SKGFirearmComponent\](/skgsfdocs/components/skgfirearmcomponent.md)'s \`GetMuzzleProjectileTransform\` as the Launch Transform. Put the shooter and the firearm's attachments in Actors To Ignore so the bullet doesn't hit them. Bind On Impact to handle what the bullet hits, such as damage and impact effects. The example's BP\\\_Firearm does this in its FireShot function, with DA\\\_556 in its Projectile variable. !\[BP\\\_Firearm ignores its owner and attachments, fires DA\\\_556 from GetMuzzleProjectileTransform, and binds On Impact to OnProjectileImpact\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-09508084b56695b882f5119caecc8c979e2df4e8%2Ffire-projectile.png?alt=media) ## Projectile Definition !\[DA\\\_556, which uses the default values\](https://269935405-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGVoX298kWuMi1eriEGGl%2Fuploads%2Fgit-blob-cb77144b33bd360c3506a364cf8dfda78da037d4%2Fprojectile-definition.png?alt=media) \* \*\*Velocity\*\*: Speed when fired in cm/s. 75000 (750 m/s) by default. \* \*\*Weight\*\*: Weight in grains. Currently has no effect. \* \*\*Drag Coefficient\*\*: How quickly the bullet slows down. Higher slows it faster. 0.283 by default. \* \*\*Lifetime\*\*: Seconds before a bullet that hasn't hit anything is removed. 6 by default. \* \*\*Collision Channel\*\*: The channel the bullet traces on. It hits anything that blocks it. \* \*\*Particle Data\*\*: An optional Niagara system that follows the bullet: \* \*\*Particle\*\*: The Niagara system, such as a tracer. \* \*\*Particle Spawn Delay Distance\*\*: How far in cm the bullet travels before it appears, such as 10000 for a tracer that starts at 100 m. \* \*\*Debug Data\*\*: Editor only: \* \*\*Debug Path\*\*: Draws the bullet's path in red and its impact as a green sphere. \* \*\*Line Thickness\*\*: Thickness of the path line. \* \*\*Debug Impact\*\*: Draws a sphere where the bullet hits. \* \*\*Impact Radius\*\*: Size of the impact sphere. \* \*\*Debug Lifetime\*\*: Seconds the drawings stay. ## Functions All on the SKGProjectileWorldSubsystem. ### Firing \* \*\*FireProjectile\*\*: Fires one bullet. \* \*\*Projectile ID\*\*: Your own number to tell bullets apart in the events. \* \*\*Owner\*\*: Passed back in the events, such as the shooter. \* \*\*Actors To Ignore\*\*: Actors the bullet passes through, such as the shooter and the firearm. \* \*\*Launch Transform\*\*: Where the bullet starts, pointing along its X axis. \* \*\*Visual Component Override\*\*: A component to move along with the bullet instead of spawning the Particle. \* \*\*On Impact\*\*: When the bullet hits something, with the hit, the bullet's velocity, its ID and Owner. The hit includes the surface's physical material, so this is where to play impact effects, such as with an \[SKGPhysicalMaterial\](/skgsfdocs/systems/physical-materials.md). \* \*\*On Position Update\*\*: Every step of the bullet's flight, with its location, velocity, ID and Owner. \* \*\*FireProjectiles\*\*: Fires one bullet per Launch Transform, such as shotgun pellets from \`GetMuzzleProjectileTransforms\`. Projectile IDs match the transforms in order. \* \*\*GetProjectileByID\*\*: Finds a bullet still in flight by its ID. ### Wind \* \*\*SetWindSources\*\*: The Wind Directional Source actors that push bullets. Each bullet uses the closest one. With none set, there's no wind. ### Zeroing To zero a firearm's optics, pass the location from \`GetProjectileLocationAtDistance\` to the \[SKGFirearmComponent\](/skgsfdocs/components/skgfirearmcomponent.md)'s \`ZeroOpticsForZeroAtLocation\` in a single frame. \* \*\*GetProjectileLocationAtDistance\*\*: Where the bullet is after traveling a distance in meters, with drop and drag but no wind. It's measured for a level shot along the world X axis from the Launch Transform's location, so use it for zeroing, not as a spot in the world. \* \*\*GetProjectileZero\*\*: The rotation that zeroes a sight to a distance in meters, from the Launch Transform and the sight's aim transform. \* \*\*GetProjectileZeroAtLocation\*\*: Same as GetProjectileZero, but to a location from \`GetProjectileLocationAtDistance\`. \`ZeroOpticsForZeroAtLocation\` uses it. --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://sneakykittygamedev.gitbook.io/skgsfdocs/systems/projectiles.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with \`ask=how do I create an API token\`, a goal like \`automate deployments from our CI pipeline\` lets GitBook tailor the answer to that use case. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. ---