Handling twin stick projectiles

Hello friends.
I’m creating what is essentially a twin stick rogue like.
I have my classes in place however I can’t find the best way to handle increasing projectile count per spell when picking up an upgrade (other upgrades too, specific to the spell).

Example case you have fireball and you find an upgrade for the fireball counts. You now shoot two fireballs each a distance and or rotation apart from the other.
I’ve tried to create ranks of spell and having several of one type of spell.

Example fireball, fireball rank 1 etc.
Tried adding at runtime another projectile to the existing spells.

I had it working but not as intended. I had projectile spawn points on my player but that was before I added my components to handle projectiles.
I don’t want to cast and I briefly experimented with interfaces to handle it.

My system is as such:

Spell/spell upgrade - spellbook component - projectile handling component - player.

Has anybody got any tips here?

  • an actor component spawning fireballs:

  • press 1 to upgrade:

Hail Everynone. Thanks for swift and concise response.
Seems simple enough, a couple of nodes I wasn’t aware of looks like this will help.

I’ll report back.
Thanks again.

1 Like

Hello Everynone. This has helped greatly.

Alas in my initial design the projectiles would be more like Diablo - spawn at the characters forward vector thus: 1 projectile fires from centre point, 2 projectiles either side of that centre point, 3 would be 1 and 2 combined and so on. I’ll likely have 5 as the max.

I guess I could make similar functions and tweak accordingly but perhaps there is a better way.

I will be using your method as a different upgrade for firing projectiles in multiple directions.

Thank you again.

1 Like

It’s just vector rotation. Tweak it as needed. GL

1 Like