pafuhana1213 / KawaiiPhysics

KawaiiPhysics : Simple fake Physics for UnrealEngine4 & 5
MIT License
1.92k stars 287 forks source link

Kawaii Physics collision with two separate skeletal mesh #76

Closed unreal0924 closed 1 year ago

unreal0924 commented 1 year ago

I decided to have hair and body as separate skeletal mesh. Kawaii Physics worked perfectly fine when I had my hair as part of body mesh but I can’t figure out how to add collision so that the separate hair mesh does not penetrate body mesh. The hair mesh penetrates the body mesh because the kawaii physics of the hair skeletal mesh does not have any bones that can be used as root bones of the collision capsule/plane. In AnimGraph there is an option to add additional skeletal mesh to preview scene and I can somewhat use that to draw the collision spheres but because animBP obviously doesn’t recognise them as part of the skeleton the spheres are not linked to bones and will always stay in T-pose no matter what animation is being played. Is there any way to make this work using Kawaii Physics? Any ideas would be very much appreciated. Thank you in advance!

muchogrande commented 1 year ago

I also have a separate skmesh for hair, but mine has dummy bones that track the head/shoulders etc of the player. Took the idea from the ue5 valley of the ancient demo character setup. Appears to work as expected.

eatmylazer commented 1 year ago

From what I know, when you're setting it up like that it's a good practice to have the skeleton on the hair mesh as well (or at the very least the hierarchy till it reaches the hair, even if they are nothing rigged into that. You must NEVER make a spaghetti with the hierarchy and make each one have their own pathway till the root for characters). You should make the hair a child of the body inside the blueprint and them use the body as the main body driving the animations. I think it's like 3 nodes to set this up. Check how Epic do that with their own Metahuman characters.

muchogrande commented 1 year ago

I used Echo from the Valley of the Ancient Demo as ref. Set the 'hair' skmesh as child of player skmesh. Give hair skmesh a simple ABP that uses the Copy Pose From Mesh node set to 'attached parent'. String in your Kawaii goodness.