How can I make a type act like a child of an instance?

I defined how a proper R6 character structure should look like.

export type R6Character = Model & {
	["Humanoid"]: Humanoid,
	["Head"]: Part & {
		["Face"]: Decal
	["HumanoidRootPart"]: Part & {
		["Root Hip"]: Motor6D
	["Left Arm"]: Part,
	["Left Leg"]: Part,
	["Right Arm"]: Part,
	["Right Leg"]: Part,
	["Torso"]: Part & {
		["Left Hip"]: Motor6D,
		["Left Shoulder"]: Motor6D,
		["Neck"]: Motor6D,
		["Right Hip"]: Motor6D,
		["Right Shoulder"]: Motor6D

return {}

And when I tried to index a child it treated it as a regular table.


How can I define a type so that the Luau type checker will treat Left Arm as a child of an instance called Character?

1 Like

Honestly it looks more like a bug to me, using bracket operators fail the typecheck whereas dot operators are fine?

Consider filing a bug report

1 Like