Class KnockbackHitAction
Action that applies a knockback force to a target character, pushing them away from the source. Uses the KCC motor's velocity system for collision-aware knockback instead of direct Transform.position manipulation, which would bypass prediction, reconciliation and collision detection.
The displacement is SERVER ONLY — see the note in Execute(ICharacter, EventData) for why this is the
one feedback action that did not move to EcaAuthority.MayPredict. The victim's own
client receives it through the reconcile, and the attacker's client plays a cosmetic flinch
(PlayPredictedReaction(EventData)) in the meantime.
[Serializable]
public class KnockbackHitAction : BaseAction, IAction
- Inheritance
-
KnockbackHitAction
- Implements
- Inherited Members
Fields
ForceValue
The value provider that determines the initial knockback force applied to the target.
[Tooltip("The value provider that determines the initial knockback force.")]
[SerializeReference]
public IFloatValueProvider ForceValue
Field Value
Methods
Execute(ICharacter, EventData)
Applies a knockback effect to the target character if they are not immortal. Knockback is applied as a single-tick velocity impulse through the KCC motor, ensuring deterministic prediction, server reconciliation, and collision awareness.
public override void Execute(ICharacter initiator, EventData eventData)
Parameters
initiatorICharacterThe character initiating the action.
eventDataEventDataThe event data containing the target and ability information.