components should be used for code thats shared between multiple actors
I’d replace should be with can be in that statement. They are useful and efficient when shared but that should not limit their use, imho. They’re lightweight, versatile and easy to maintain.
-
if my character needs a backpack with a built-in full inventory management system, I’ll make it into an Actor Component, attach it to the player, encapsulate all logic inside and roll with it. And no one else is getting a backpack in the game, and there will be no sub classes either. I’ve just decluttered a very busy player class who does not really need to know how to split a stack of potions.
-
in a VR game, my right hand can grab onto everything and toss it. It’s a Scene Component and there is only one in the entire game. I say it’s fine to use a component.
-
in a first person shooter, the 3d HUD is a Widget Component. No one else is getting one because AI bots don’t need one.
Sharing is caring but that’s not all.
Besides that, nothing is stopping you from granting those projectile components to some of the sharpshooting mobs. You could even:
- base ability class
– projectile
— projectile Player
— projectile AI
The AI and the Player are given respective projectile comps.