ProceduralHitReactions
  • Welcome
  • Getting Started'
    • Getting Started
    • Core Concepts
  • Recipes & Workflows
  • Advanced
  • Modules
    • Reaction Profiles
    • BodyPartReactor
    • HitReactionController
    • HitReactionTrigger
  • Extra
    • Troubleshooting & FAQ
Powered by GitBook
On this page
  • ReactionProfile
  • Inspector Reference
  • Practical Tips
  • Creating Variants
  1. Modules

Reaction Profiles

ReactionProfile

A ReactionProfile is a ScriptableObject asset that stores how a hit should look and feel. Because profiles live outside prefabs you can reuse the same Light‑Hit, Heavy‑Hit, or Explosion profile across dozens of characters.

Where is it? Create ▸ HitReactions ▸ ReactionProfile in the Project window, then select the asset to open this inspector.


Inspector Reference

1. Timing

Property
Default
Description

Reaction Duration

0.3

Total time (in seconds) from impact to fully recovered pose.

Blend‑In Speed

5

How fast weight climbs to 1.0 after a hit. Higher = snappier.

Blend‑Out Speed

5

How fast weight drops back to 0 once the timer expires.

2. Blend Curve

Property
Default
Description

Blend Curve

EaseInOut ⤶

Shapes the weight over time. Replace with a custom AnimationCurve for overshoot, bounce, etc.

3. Rotation

Property
Default
Description

Use Rotation

✔️

Toggle rotational offsets entirely.

Rotation Strength

(10,10,5)

Maximum random swing (deg) per axis. Use small Z to avoid barrel‑rolls.

Rotation Mode

RandomAndDirection

Choose how to mix random noise vs. direction‑aware tilt: • RandomOnly — chaotic twitch.• DirectionOnly — always tilt away from hit.• RandomAndDirection — blend both for natural feel.

Direction Rotation Multiplier

1

Controls how strongly hit‑direction influences rotation when mode supports it. 0 = ignore direction.

4. Translation

Property
Default
Description

Use Translation

❌

Enable position offsets in addition to rotation.

Translation Strength

(0.1,0.1,0.1)

Maximum random local‑space movement (m).

Translation Mode

RandomOnly

Same three modes as Rotation.

Direction Translation Multiplier

0.1

Distance (m) to push along incoming vector when direction is used.

5. Hit‑Direction Source

Property
Default
Description

Use Contact‑Point Direction

❌

On: direction = (hitPoint − bone). Good for swords & fists.Off: direction = incoming projectile velocity. Good for bullets & rockets.

6. Axis Locks

Lock individual axes for both rotation and translation (1 = allowed, 0 = blocked).

Property
Example
Description

Rotation Axis Mask

(1,1,0)

Disables roll (Z). Character can pitch & yaw but never flips.

Translation Axis Mask

(1,0,1)

Allows X/Z knock‑back while keeping Y (vertical) unchanged so feet stay planted.


Practical Tips

  • Heavy impacts: Increase Reaction Duration to ~0.7 s and lower Blend‑In Speed slightly for a sluggish recoil.

  • Subtle upper‑body hits: Disable Translation, keep Rotation Strength around (5,5,2).

  • Explosions: Set Rotation Mode = DirectionOnly, Direction Rotation Multiplier = 2, and enable Translation with a 0.5 m push.

  • Networked games: Store profile GUIDs and sync only the hit parameters to other clients—every rig will reproduce the same offsets deterministically.


Creating Variants

Right‑click an existing profile → Duplicate to branch a new variant. You can then swap profiles at runtime or per weapon via code:

reactor.profile = heavyHitProfile; // on shotgun pellets

Next Up

Head to BodyPartReactor Inspector to see how profiles plug into each bone and which runtime toggles affect blending.

PreviousAdvancedNextBodyPartReactor

Last updated 10 days ago