AbilitySpawnTarget - jimdroberts/FishMMO GitHub Wiki
Specifies the target location or entity for spawning an ability. Used to determine where an ability effect or object should appear in the game world. This enum is part of the FishMMO ability system and helps configure ability behaviors for different targeting scenarios.
-
Self = 0
Spawn at the caster (self).
-
PointBlank
Spawn at the caster's position (point blank).
-
Target
Spawn at the selected target.
-
Forward
Spawn forward from the caster.
-
Camera
Spawn at the camera's position or direction.
-
Spawner
Spawn at the spawner's position.
-
SpawnerWithCameraRotation
Spawn at the spawner's position with the camera's rotation.
- Use
AbilitySpawnTarget
to configure where an ability should be spawned in ability templates or scripts. - Assign the appropriate enum value based on the desired spawn logic (e.g., self, target, forward, etc.).
- Integrate with ability spawning logic to interpret the enum and position spawned objects accordingly.
- No additional configuration is required; values are set in code or via the Unity Inspector where supported.
// Example 1: Using AbilitySpawnTarget in an Ability Template
// This example demonstrates how to use the AbilitySpawnTarget enum to control
// where an ability effect is spawned in the game world.
public class MyAbility : MonoBehaviour
{
public AbilitySpawnTarget spawnTarget = AbilitySpawnTarget.Target;
void SpawnAbilityEffect()
{
switch (spawnTarget)
{
case AbilitySpawnTarget.Self:
// Spawn at the caster
break;
case AbilitySpawnTarget.Target:
// Spawn at the selected target
break;
// Handle other cases as needed
}
}
}