Component on all instances of class
Is there any way to construct a component on all instances of a class like a Humanoid? I could create a controller and add a component on player joined/character added but I think that is unnecessary
4 Replies
Find all the Humanoids and give them the components? Is that what you mean?
Yes, moreso targeting only player humanoids, but that can be achieved using a predicate
I would also want it to create components on such instances created at runtime, for obvious reasons
Scripting API | Flamework
Flamework exposes a Components singleton which can be used on both server and client. Inside, there are several methods that allow you to interface with Flamework's components. You can grab a reference to this singleton the same way as you do any others, as documented.
Solution
I just used a controller and a macro to create them