Hi! I’m planning to make a PvP game using skinned meshes for the StarterCharacter. I’ve done some research and I could not figure this out: how to find the body parts in a skinned mesh, via script?
Let me explain: let’s say I want to a sword to detect when I hit the head so it deals double the normal damage. In a normal R6\R15 rigs, I’d use a conditional check to see if the sword hitbox touched the head. However, in a skinned mesh there is no such thing as individual body parts, so I’m a bit concerned about how welding objects and hitbox detection could work.
Is it a good idea to use skinned meshes for this type of games? There is little to no documentation and the technology seems rather rudimental, which makes me question if it’s worth trying using it or not.
Is it possible to detect the bones of the mesh and use the hit detection that way?
I had just looked up what skinned meshes are and I was right about my knowledge in the first post
not sure how accurate or fast that would be. I’m pretty sure that HitBox parts will lack behind skinned meshes, but it is the only possible way I know to make “dynamic” hitbox collision detection. You can’t really detect SkinnedMesh collision properly, the collision is static and it retains it’s position even if you move a bone, that’s why a lot of games even outside of Roblox use HitBoxes surrounding each bone of a Playermodel. And hitbox collision are way easier to detect, than bones
You are right about Bones acting similar to Motor6D. To attach HitBoxes to individual bones, you can do something like this:
HitBox.CFrame = bone.TransformedWorldCFrame
TransformedWorldCFrame gives you bone’s CFrame of an animation, similar to how Transform works. The only difference is that it gives WorldCFrame, which is what you would probably prefer to use. Use this on every bone you need collision for by iterating through table and etc. https://developer.roblox.com/en-us/api-reference/property/Bone/TransformedWorldCFrame
I suggest you to read Developer website from Roblox more. It has all the useful properties and tutorials for certain aspect of Roblox Instances, services and much more