I have attached the hair mesh to the Head socket but the hair mesh is not following the animation.
hair mesh is called Hair_Mesh and has been attached in the editor while the Hair skeletal mesh component is already sets to UPROPERTY(EditAnywhere, Category = “Components”)
it doesn’t seem you’re actually attaching your Hair to your head socket; the socket is specified as second argument in SetupAttachment (and if you shouldn’t need the “attachtocomponent” afterwards). Just try
headSocket should be the name of your socket (and again, you do not need that attachToComponent afterwards – you’re already attaching your hair with setupattachment). Also, either you attach this in code or in the editor; looks like you’re prone to the former approach, and you’re doing it right with your UPROPERTY.
Your Solution works but only when the game is in play mode.
In the editor the hairs and the head socket is still not welded.
I have tried with the blueprints and works perfectly but I want the same thing to achieve in C++ code.