How would I make my hair mesh nicely fit on my lil assistants head?Current head size:
0.781, 0.393, 0.391
What I want to do is make it so any hair that is added to the guys head will rest nicely on it, I could go through this hat by hat and manually do it for all however this is inefficient and the offset would be too much if the player was not facing front
What could possibly make it so any hair would nicely fit depending on its scale? (mesh scale is set to
.4, .4, .4)
local Assistant = plr.Character.Assistant
local Part = Instance.new("Part")
Part.Parent = Assistant.Head
Part.Size = Assistant.Head.Size
Part.CFrame = CFrame.new(Assistant.Head.Position) + Vector3.new(-0, 0.05, 0.1)
Part.Orientation = Assistant.Head.Orientation
Part.Anchored = false
local Mesh = Instance.new("SpecialMesh")
Mesh.Parent = Part
Mesh.Scale = Vector3.new(0.4, 0.4, 0.4)
Mesh.MeshId = "TheIdIWilluseForTheMeshIsHere"
local Weld = Instance.new("WeldConstraint")
Weld.Parent = Assistant.HumanoidRootPart
Weld.Part0 = Assistant.Head
Weld.Part1 = Part
Weld.Part1 = Part
For my solutions, I’d usually apply an accessory with a HairAttachment in the Handle. I’m uncertain whether the hair scales with the character size when shrunk.
Ouch, I didn’t think of a created hair instance, I was thinking about storing the preset hairs inside the ServerStorage and parenting the accessory directly on the character.
Alrighty, would parenting it be more efficient than creating a new instance? I’ll do it for now anyways until you get back to me on that instance (hopefully) since I’m rather stuck here. I appreciate the help though.
(marked as a solution until a more efficient way is found since it is, technically a solution and doesn’t look like anyone else intends to reply.)
The Handle is a BasePart which you’ll apply the mesh on. Make sure these conditions are met:
The Accessory is the parent of the Handle.
The HairAttachment is child of the Handle.
The Accessory is in ServerStorage initially.
A script should clone and parent the accessory on the character only, you may tweak the HairAttachment for the desired placement.
I think you could create a new instance, but the problem is that it is difficult to maintain it consistently for all scales. An accessory would fix that in no time.
Ah right, also another issue appears to be that it adds the hat to the avatar many times…or in this case far away from the avatar. Regardless it’s replicating itself for some odd reason.
Localscript in the image button
local remote = game.ReplicatedStorage.RemoteEvents:WaitForChild(“Test”)
The accessory and attachment method only works if you’re using AddAccessory or rather that’s how it should be. If you are using accessories, the canonical way to append them to characters is not by parenting but by doing the following:
A Handle BasePart under an Accessory object
An attachment that is named the same as one within the character
Call AddAccessory on the character’s humanoid and pass the accessory as an argument
AddAccessory automatically “matches up” accessories. For example, you have a hair accessory. You must name the attachment “HairAttachment”. Once AddAccessory is called, it will attach the HairAttachment from the accessory to the HairAttachment of the character.