Getting Started
Setup Instructions
Follow these steps to set up the hit effects in your project:
1. Shimmer Layer Setup
- Add a new Layer named
Shimmer
. - Select the
CritHitShimmer
Prefab and make sure its Layer is set toShimmer
. - Make sure the Shimmer Camera is set to only render the
Shimmer
Layer, and your Main Camera should exclude theShimmer
Layer.
2. URP Setup
-
Open URP Settings:
- Go to Edit > Project Settings > Graphics.
- Double-click the Universal Render Pipeline Asset to open it in the Inspector.
-
Add the Shimmer Renderer:
- In the pipeline asset inspector, add the
Shimmer Renderer
to the list of renderer data.
- In the pipeline asset inspector, add the
-
Default Renderer Setup:
- In the Default Renderer, scroll down and click
Add Render Feature
-Full screen Pass Renderer Feature
. - Add the
Shimmer Renderer Feature
.
- In the Default Renderer, scroll down and click
-
Assign Renderer to Camera:
- Select the Shimmer Camera and set its Renderer to the newly added Shimmer Renderer.
3. HDRP Setup
- Drag the
ShimmerPass
Prefab into your scene. - In the ShimmerPass component, set the Target Camera to your Main Camera.
4. Testing the Effects
- In the demo scene, locate the
Effects
GameObject. - Use the
Effect Test Controller
component to preview and test the hit effects in play mode.
Damage-Based Settings
You can customize the hit effects dynamically based on gameplay damage by passing two key properties into the VFX Graph when triggering the effect:
1. Damage Intensity
(Float)
- This controls the overall intensity of the effect based on the damage dealt.
- Value should be in the range of
0.0
to1.0
. - A common approach is to set this based on the damage roll, e.g., in typical RPG systems with min/max damage.
- If you don’t want to use it, pass
-1
. This will cause the effect to display at maximum intensity, same as if you set it to1.0
. - Feel free to define this however it fits your game’s combat system.
2. Is Critical Hit
(Boolean)
- Set to true to trigger critical-specific effects.
- Set to false for normal hits.
Effect Structure
- The hit effect is split into two VFX Graphs:
- Shimmer Graph – Handles postfx distortion and sits on a separate GameObject Layer for rendering.
- Main Effects Graph – Includes all other visual elements like flash, spikes, dust, motion blur, backgrounds, etc.
How to Use Damage-Based Settings
Spawn Control (Per Effect)
-
Inside the Spawn Context of any effect block:
-
Use the
value shown in the picture
to control whether an effect spawns. -
For example:
Set the value to 0.8
→ This means the effect will only spawn if the damage intensity is greater than or equal to 0.8.
Size Control (Output Context)
- In the Output Context, you can set the size multiplier range.
Opacity Control (Shader Graph)
- For damage based opacity, set the range in the shader graph.
This setup allows you to make your effects feel dynamic and reactive, emphasizing the power of each hit visually based on gameplay data.
Last updated on