Table of Contents

Class AbilityForkHitAction

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

Action that turns an ability object onto a new heading inside a cone when it hits something — a projectile that scatters or ricochets off its target rather than carrying straight on.

[Serializable]
public class AbilityForkHitAction : BaseAction, IAction
Inheritance
AbilityForkHitAction
Implements
Inherited Members

Remarks

This used to do nothing. It assigned abilityObject.Transform.rotation, but an ability object's position is a closed form evaluated from its spawn pose and its integer tick count (AbilityMoveTransformAction), so the next tick recomputed the position from the original spawn line and threw the turn away. The projectile kept flying dead straight while its mesh — and the knockback direction, which KnockbackHitAction reads off Transform.forward — spun to a heading nothing travelled along. FishMMO.Shared.AbilityObject.Redirect(UnityEngine.Quaternion) moves the closed form's own inputs instead, which is what actually starts a new leg.

Runs on every peer, like the rest of the OnHit chain. The new heading is drawn from the ability object's own RNG, whose state is carried in the reconcile, so the server and the caster's owner turn the same way for the same hit.

An observer forks on the server's hit, not on one of its own. This action used to be the loudest symptom of a third-party observer resolving hits against its own interpolated world: for most OnHit actions an invented hit cost an effect in the wrong place, but for this one the observer's copy veered onto a heading the server never took and stayed wrong for the rest of its life — and, because the trajectory is a closed form re-anchored by FishMMO.Shared.AbilityObject.Redirect(UnityEngine.Quaternion), the destroy message then ended it somewhere the server's copy had never been. Observers no longer sweep; they are told which body was hit (AbilityObjectHitBroadcast) and run this action from that, so the fork they draw is the one that happened. See FishMMO.Shared.AbilityObject.ResolveSweptHits().

Fields

ArcValue

The value provider that determines the total arc, in degrees, the new heading is drawn from.

[Tooltip("The value provider that determines the total arc in degrees for the fork spread. 90 means 45 degrees either side of the current heading.")]
[SerializeReference]
public IFloatValueProvider ArcValue

Field Value

IFloatValueProvider

Remarks

A TOTAL spread about the current heading, so 90 means 45 degrees either side. Zero leaves the heading alone; 360 or more is any direction at all.

Methods

Execute(ICharacter, EventData)

Turns the ability object onto a new heading drawn from within the configured arc.

public override void Execute(ICharacter initiator, EventData eventData)

Parameters

initiator ICharacter

The character initiating the action.

eventData EventData

The event data containing ability collision information.