You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you wish to document the format behind the CollisionGroupData property -
here's luau code that generates CollisionGroupData-like output using buffers.
CollisionGroupData=function()
localcollision_groups=game:GetService("PhysicsService"):GetRegisteredCollisionGroups()
localcol_groups_n=#collision_groupsifcol_groups_n==0thenreturn"\1\0"endlocalbuffer_size=2-- Initial sizefor_, groupincollision_groupsdobuffer_size+=7+#group.nameendlocalb=buffer.create(buffer_size)
localoffset=0buffer.writeu8(b, offset, 1) -- ? [CONSTANT] Version byte (likely)offset+=1buffer.writeu8(b, offset, col_groups_n) -- Group countoffset+=1fori, groupincollision_groupsdolocalname, id, mask=group.name, i-1, group.masklocalname_len=#namebuffer.writeu8(b, offset, id) -- IDoffset+=1buffer.writeu8(b, offset, 4) -- ? [CONSTANT] Not sure what this is (also not sure about u8, could be i8)offset+=1buffer.writei32(b, offset, mask) -- Mask value as signed 32-bit integeroffset+=4buffer.writeu8(b, offset, name_len) -- Name lengthoffset+=1buffer.writestring(b, offset, name) -- Nameoffset+=name_lenendreturnbuffer.tostring(b)
end
Hopefully it's enough.
Feel free to correct the code if it's wrong!
The text was updated successfully, but these errors were encountered:
If you wish to document the format behind the CollisionGroupData property -
here's luau code that generates CollisionGroupData-like output using buffers.
Hopefully it's enough.
Feel free to correct the code if it's wrong!
The text was updated successfully, but these errors were encountered: