Magic

The MagicAction component is used to create items that can cast spells. It is the most flexible of the ItemActions but also the most complex.

The Module groups for the MagicActions are

  1. Trigger [S]: Simple, repeat or burst are usually used.
  2. Usable [M]: For any module shared between an UsableItemAction.
  3. Caster [S]: The main magic module will control how the spell is cast.
  4. Begin [M] : Start and stop effects while beginning the magic cast.
  5. Cast Effect [M]: The effects of casting.
  6. Impact [M]: The impact action. Some cast effects invoke collisions that can impact.
  7. End [M]: Start and stop some effects at the end of the cast.
  8. Extra [M]: Any other modules that are specific to magic but does not fit in any other group.
Groups noted as ‘[S]’ may only have a single module active at once. This usually will be the first enabled one in the list.
Groups noted as ‘[M]’ can have many modules active at once. Usually all the enabled modules are considered active.
The Magic Action use flow is:

Caster

The Caster modules are used to casting the Cast Effects.

The MagicCastData contains the following properties

  • Cast Origin: The Transform where the cast should originate from.
  • Cast Position: The point where the cast should fired.
  • Direction: The direction in which the cast will be fired.
  • Cast Target Position: The position of the target.
  • Initial Start Cast Time: The first cast start time since start use.
  • Start Cast Time: The last cast start time since start use.
  • Target Index: The index of the target.
  • Targets: List of targets.
  • Cast ID: The ID of the cast to differentiate it if the cast loops.
  • Cast Normal: The normal vector of the cast target.
  • Detect Layers: The LayerMask of the layers that should be detected.
Simple Caster

A caster module with basic functionality. The caster module is used to detect the targets initiate all the casting effects.

Begin & End

The Begin and End module groups share the same type of MagicStartStopModule.

These are modules that have a Start, Update and Stop function.

Generic Item Effects

Invokes Generic Item Effects on start and/or stop.

Fade Materials

Fades the materials on the character.

Play Audio Clip

Start and stop an AudioClip, perfect for AudioClips that need to loop until they should be stopped.

Spawn Particle

Spawn particles. This is perfect for particles that need to loop until they should be stopped.

Toggle GameObject

Enable or disable a GameObject between start and stop.

Cast Effect

Cast effects can start and complete. It differs from StartStop modules because the caster knows when the cast has completed by checking that the cast effects are done.

Physics Cast

Do a Raycast, SphereCast or OverlapSphere to detect targets to impact.

Play Audio Clip

Play audio while casting.

Spawn Object

Spawns an object when the cast is performed.

Spawn Particle

Spawns a particle when the cast is performed.

Spawn Projectile

Spawns a projectile when the cast is performed.

Start Effect

Starts an effect on the character.

Target Impact

Impact the caster target.

Teleport

Teleports the character.

Cast Item Effects

Invokes Item Effects from an ItemEffectGroup.

Magic Cast Effect Nester

Repeat certain cast effects in a loop0

Impact

Invoke functions when the a cast impacts a target.

Generic Shootable Impact Module

Invoke Impact Action Group

Ricochet Impact

The Ricochet action will cast a new CastAction for nearby objects, creating a ricochet effect.