← Back to all addons

New Spread Ability (Extension for projectile) (3.1) 🌟πŸ”₯

Posted by Mr.Titan on Apr 26, 2025 at 1:44 PM

ExperimentalFeature3.0 Verified
πŸ’‘ 5

It extends functionality to the current “Projectile” ability by integrating class based bheaviour, allowing to extend as much as you like! ** Don’t Worry** this will not break anything, and the “Standard” spread logic will be defined by default. Sprites in the comments.

** How to use: **

  • All your projectile abilities stay with the “cone spread” just like standard.
  • To use the “circular” spread, change your ability spread type sheet from “cone” to “circular”.
  • The circular effect depends on the Projectile Count you setup.

** Abilities Example: **

  • (1ΒΊ in the video) Duplicate AB_FIRECONE and name it “AB_FIRESPLIT”, set spread type to Circular, speed to 8 and count to 3
  • (2ΒΊ in the video) Duplicate AB_FIRECONE and name it “AB_FIRESTAR”, set spread type to Circular, speed to 5 and count to 6

** Steps: **

  • Import ** iAbilityProjectileSpreadType ** into “Scripts/Database/Abilities/Active/Utils/iAbilityProjectileSpreadType.cs”, you will need to create that “Utils” forder btw.
  • In ** ProjectileAbilitySheet.cs** add this 2 properties:
        [Header("Spread Type")]
        [SerializeField] private SpreadTypeEnum m_spreadType = SpreadTypeEnum.Cone;
        

        public SpreadTypeEnum spreadType => m_spreadType;
  • In ** ProjectileAbility.cs** replace the method “ThrowProjectile” with the following:
        private void ThrowProjectile(int projectileIndex)
        {
            // Get a direction based on angle around the caster
            Vector2 actualDirection = AbilityProjectileSpreadType.getDirection( activeAbilitySheet.spreadType,this, m_character, projectileIndex);

            Projectile projectile = InstantiateProjectile(m_projectileSpawnPoint.position);
            projectile.Throw(m_character, actualDirection, activeAbilitySheet);
        }

New Spread Ability (Extension for projectile) (3.1) 🌟πŸ”₯

πŸ’¬ Comments (4)

Gyvr Apr 26, 2025 at 01:46 PM
Wow! I could imagine some cool bosses using these variants!
❀️ 2
Gyvr Apr 26, 2025 at 01:46 PM
This is for sure going to help many people
Mr.Titan Apr 26, 2025 at 01:49 PM
That’s exactly my purpose: repeatable circular attack! I’ll try to put the repeatable up soon, also.
πŸ‘Œ 1
Mr.Titan Apr 26, 2025 at 01:54 PM

** Sprite here ** I did it so use it if you’d like. Just replace you sprite file with this one in the explorer “NOT IN UNITY WINDOW” and then go to unity, edit the sprite setting MANUALLY the tiles.

If you do otherwise, you will probably lose the pointer of the sprites in other places.

❀️ 2

Want to continue the conversation?