Table of Contents

Class PlayFXAction

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

Action that plays a visual effect (FX) at a determined position, typically at the point of collision or interaction.

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

Fields

FXPrefab

The FX prefab to play when this action is executed.

[Tooltip("The FX prefab to play.")]
public GameObject FXPrefab

Field Value

GameObject

Properties

IsPresentation

Purely presentational: particles and nothing else.

public override bool IsPresentation { get; }

Property Value

bool

Remarks

This is the one action in the project whose whole effect is a rendered object, so it is the one action that may still run on a peer whose selector declined to resolve — see IsPresentation.

Methods

Execute(ICharacter, EventData)

Plays the FX prefab at the collision or interaction location.

public override void Execute(ICharacter initiator, EventData eventData)

Parameters

initiator ICharacter

The character initiating the action.

eventData EventData

The event data containing collision or interaction information.

Remarks

The FX is spawned wherever TryResolveSpawnPosition(ICharacter, EventData, out Vector3) lands — the impact point a CollisionEventData carries, then the event's own target, then the ability object the event belongs to, then the initiator.

It used to read Collision.contacts[0]. That threw as soon as anything dispatched a hit without a Unity collision — AbilityApplyAreaAction always did, and now every ability hit does, because AbilityObject resolves them with a swept query so they can be lag compensated. The event carries the impact point directly instead.

VFX instantiation is suppressed during prediction replay ticks to prevent visual spam.