I am making a system where if a character spawns they get their hair colored based on a game race. Is there any way I can distinguish hair from a regular accessory?
I believe all hair accessories will have an attachment inside them called “HairAttachment”. You could perform a check to see if the attachment exists and if it does, it’s a hair accessory.
No, you aren’t able to distinguish between accessories. The only way you can do so effectively is through the above which is to find if there is an attachment named HairAttachment in the accessory’s handle. Without some kind of marking like this, you can’t identify between accessories.
If you’re working with Roblox accessories, any hair accessory will always be guaranteed to have the HairAttachment attachment in it (and the reliability stops there as well). Further than that, you will need to make sure there’s a way to distinguish accessory types yourself.
Not sure if this is a new feature, but:
You can use AccessoryType to determine the type of accessory it is (enum)
Edit: the only problem is that ugc hair is also defined as a hat since they cant actually upload hairs, but a hat that just looks like hair.
Not to be the bearer of bad news, but this post is two years old. I’m sure your solution is better, but the current solution is sufficient enough.