New Spread Ability (Extension for projectile) (3.1) ππ₯
π‘
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)
** 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.
Want to continue the conversation?