Skip to content

Commit 70e7979

Browse files
Merge pull request #50 from Metallochrome/bonetree
fix: Prevent creation of duplicate bone children
2 parents b4ba1ee + 5052781 commit 70e7979

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src-build/init.luau

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,13 @@ function Class:m_CreateBoneTree(RootPart: BasePart, RootBone: Bone)
152152
HasBoneChild = true
153153
end
154154
end
155-
155+
156+
if string.sub(Bone.Name,#Bone.Name-3,#Bone.Name) == "_end"
157+
or string.sub(Bone.Name,#Bone.Name-4,#Bone.Name) == "_Tail"
158+
then
159+
HasBoneChild = true
160+
end
161+
156162
if not HasBoneChild then -- Add tail bone for transform calculations
157163
SB_VERBOSE_LOG(`Adding tail bone`)
158164
local Parent = Bone.Parent

src/init.luau

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,13 @@ function Class:m_CreateBoneTree(RootPart: BasePart, RootBone: Bone)
152152
HasBoneChild = true
153153
end
154154
end
155-
155+
156+
if string.sub(Bone.Name,#Bone.Name-3,#Bone.Name) == "_end"
157+
or string.sub(Bone.Name,#Bone.Name-4,#Bone.Name) == "_Tail"
158+
then
159+
HasBoneChild = true
160+
end
161+
156162
if not HasBoneChild then -- Add tail bone for transform calculations
157163
SB_VERBOSE_LOG(`Adding tail bone`)
158164
local Parent = Bone.Parent

0 commit comments

Comments
 (0)