ShieldController

The ShieldController is the brain of the system. It handles shield health tracking, damage reactions, and the triggering of state-based animations. To function, it requires a ShieldBehaviorConfig file, which defines how the shield responds to hits. You can easily create one in your project folder via:

Right Click→ Create → SF Studio → Shields → ShieldBehaviorConfig (We’ll cover the config in detail later.)

When you attach the ShieldController to a 3D object, several required components are automatically added to ensure everything works out of the box:

Sphere Collider

Used as the shield’s physical boundary for collision detection.

Shield Breathing Controller

Automatically adapts the sphere collider’s size based on the shield’s breathing frequency and strength, keeping the collider in sync with the visual animation.

CopyMaterialProperties

Copies specific material properties (like breathing and instability values) from the main shield to the instantiated hit effect. This ensures that the temporary masked shield spawned during a hit has perfectly matching visuals.

RigidBody

Required for collision events.

💡 Tip: Disable Use Gravity and freeze all position and rotation constraints to prevent unwanted physics interactions.

Last updated