[SOLVED] When rotating bones, rays behave as if the mesh hasn't rotated

If you’re working on a FPS don’t use a Ragdoll.
Usually a Ragdoll is when each bone is connected by a string, much like a puppet. I don’t know if it being kinematic keeps the bones in place, but the problem you might encounter then is how to combine a Ragdoll with BetterCharacterControl so you can have the npc walk around and jump and stuff.

What I’d suggest you to do is manually adding stretched spheres and boxes for relevant bones (like who needs different values for each toe or similar: Should a toe be shootable at all).

I’ve done it in very basic form here, you can see the dark-blue hitboxes, the red lines are the individual bones and the cyan box tracks the location of the head and back bone.

Yes you have to do it manually but this also comes at the benefit of tweaking the boxes, for instance you could have a bigger head hitbox than the head actually is, to simplify headshots and the like. That way you not only know which bone was hit but also have a lever to play around for game balance purposes (and you could always use the foot-mesh poly reduced if you wanted to shoot toes).

One thing to note though is that collideWith currently does not operate on a List of Spatials, so you can’t just say “Trace all Hitboxes and obstacles (the world geometry)”. You could only run it on the rootNode which would also have the high-poly player/npc models and the guns itself.

1 Like