Bro Code logoBRO CODE CRINDEPENDENT GAME DEV TOOLS
← All abilities
ABILITY 04

RangePower

Fire pooled projectiles toward the mouse with configurable shot count, speed and aim angle.

Activation

RangePowerButton

Example use

Explore the setup guide below to configure this ability.

Ability documentation
CHARACTER ABILITY
SETUP GUIDE

Set up this ability

Component
CharacterRangePower
Source
Scripts/Abilities/CharacterRangePower.cs
Animator bools
RangePower

Component dependencies

Requirements for this ability and its targets
ComponentWhere to add or assign itPurpose / setup
MMObjectPooler / MMSimpleObjectPoolerAbility GameObject, or explicitly assigned through ObjectPoolerRequired for firing. Add MM Simple Object Pooler, assign a projectile prefab to its pool, then assign the pooler to ObjectPooler or let the ability find it on the same GameObject. The projectile prefab needs the Corgi Projectile component for the configured direction and speed behavior.
Camera tagged MainCameraSceneRequired for converting the mouse position into the world aim point.

Visual component dependencies

These components support the associated effect. A missing optional visual does not by itself imply that the gameplay mechanic cannot run.

Visual dependencies
ComponentWhere to add or assign itPurpose / setup
ReticlePrefabAssigned prefab fieldOptional aiming marker. Missing it removes visual feedback but does not prevent firing.
  1. Add CharacterRangePower and an MMObjectPooler, such as MMSimpleObjectPooler, on the ability GameObject. Configure the pool with your projectile prefab.
  2. Assign ObjectPooler or let the component find it on the same GameObject. The helper CharacterProjectileHandler is added at runtime.
  3. Optionally assign RecticlePrefab 1 to ReticlePrefab. A MainCamera-tagged camera is needed for mouse aiming.
  4. Set ProjectilesPerShot, ProjectileSpeed and ValidAngleThreshold. ProjectileSpeed = 0 preserves the projectile prefab speed.
  5. Press RangePowerButton while aiming inside the allowed angle. ProjectileSpam = true stops the ability after firing; cooldown still applies.

Inspector reference

These are C# field declaration defaults. Existing prefab and scene values can override them. Shared fields are documented under Ability Configuration.

CharacterRangePower fields
FieldTypeDeclared default
OffsetPositionVector3Vector3.zero
OffsetFlippedPositionVector3Vector3.zero
ProjectilesPerShotint1
ProjectileSpambooltrue
ProjectileSpeedfloat0f
SpreadVector3Vector3.zero
RandomSpreadbooltrue
ObjectPoolerMMObjectPoolerNot assigned in declaration
ReticlePrefabGameObjectNot assigned in declaration
ValidAngleThresholdfloat90f
ReticleResetTimefloat3f

Usage notes

  • This is a mouse-aimed projectile ability, not simply a range multiplier. It bypasses the normal weapon slot workflow.
  • Projectiles are directed toward the mouse aim point after spawning.
  • No MMObjectPooler prevents initialization. A missing reticle only removes visual aiming feedback.