robertocasanovi

I'm making an hair salon game in which the player can brush (move) the character's hair. The effect I want is pretty much this one
(go to minute 2.00)



What's a good way to achieve this?

What I tried:

IK constraints
this solution is perfect if I need to move an arm or a leg but doesn't feel right for an hair, since the joint between the bones can bend only in one direction (given by the "positive/negative" option in Spine)

path constraint
the problem here is that there's no target to move at runtime and I don't really know how to handle the drag

hinge chain
again, the way the hair moves seems right but I can't find a way to implement the correct dragging at runtime
robertocasanovi
  • Posts: 6

Harald

It should be achievable by a hinge chain setup. You could have a Rigidbody collider attached at the mouse or touch position which moves the hair around by colliding with it in the usual way. Please consult Unity documentation and the Unity forum for additional info on the topic or how to move Rigidbodies programmatically.

In general any of the above solutions should work, but you need to combine multiple layers of systems to achieve a result that feels good. E.g. a physics / interaction layer to move around the position of the important bones and IK or path constraints to define how the attachments react to the key-bone locations.
User avatar
Harald

Harri
  • Posts: 2075


Return to Unity