Help with height system (R6)

1.I want to make a full height randomizer which I have nearly finished.

  1. The body comes the way I perfectly wanted, although the head is the problem. It does not come out natural at all. The head itself tends to be separated from the body when the height is too tall and tends to get inside the torso when the height is too short, the only time of when the head actually looks normal is around the heights of: 0.9, 1, 1.1.

Images: image (1) image

  1. I have spent at least 4-5 hours looking through systems of how to do make a r6 height system and I have came up with one that is fit to my taste, although none of them really had the randomized values that I use which is a big deal considering that the head itself is completely different height compared to the body itself. The only thing that I have found regarding of this situation is the right size of the head which uses the formula math.max and is used on the Width and Depth which gives (I believe) the perfect size for it.

the randomizer:

		local Height = math.random(500, 1000) / math.random(500,750)
		local Width = 1 / (Height / 0.95)
		local Depth = 1 / (Height / 0.95)

The head size:

local HeadVector = Vector3.new(math.max(Width,Depth),math.max(Width,Depth),math.max(Width,Depth))

Motor6d’s calculation:

			for i, motor in pairs(character.Torso:GetChildren()) do
				if motor:IsA("Motor6D") then
					local pos0, pos1 = motor.C0.Position, motor.C1.Position
					motor.C0 = CFrame.new((pos0 * Vector)) * (motor.C0 - pos0)
					motor.C1 = CFrame.new((pos1 * Vector)) * (motor.C1 - pos1)

Body size:

			for i, part in pairs(Parts) do
				part.Size = part.Size * Vector
				end
1 Like

So add half the body height and half the head height for the CFrame value head Position.

Half the body height plus the body position will be the top surface of the body.
The top surface of the body plus half the head height would be the head Position.

If you look at the normal R6 avatar, the head is a 2x1x1 Part, with a HeadMesh that has a scale of (I think) 1.25, 1.25, 1.25, making the actual head look like it’s 1.25 studs in all directions and which sinks it into the Torso by .125 studs

1 Like

So, basically

		local Surface = Vector3.new(0,Height,0) / 2 + HeadVector / 2
		local Position = Surface + HeadVector / 2

?
Or maybe,

		local Surface = Height / 2 + HeadVector.Y / 2
		local Position = Surface + HeadVector.Y / 2

Figured it out, thanks a lot! I really appreciate it :slight_smile:

1 Like

Alright, this might be irritating, but I have to tell you that, somehow and some way, the head itself separates from the body when it’s playing a animation while the rest of the body parts are intact and is working properly.

The problem/issue:
Problem with head

The code for the head:

if motor.Name == "Neck" then
						motor.C0 = CFrame.new((motor.C0.Position * Vector3.new(HeadVector.X,HeadVector.Y,HeadVector.Z))) * (motor.C0 - motor.C0.Position)
						motor.C1 = CFrame.new((motor.C1.Position * Vector3.new(HeadVector.X,(Height / 2 + HeadVector.Y / 2) + .125,HeadVector.Z))) * (motor.C1 - motor.C1.Position)
					end
				end

Hi!

How come you do not resize your character with the scale options under Humanoid?
image

Because it’s not R15, I am making it for R6, which needs way more work and much more customization stuff for it to work. Unlike R15, R6 doesn’t have the humanoiddescription thing; I have tried applying one to it, but it did not work. So, in order to be fixed, the problem requires a different solution, as I have no idea why it even gives that problem in the first place.

Okay in that sense. How come you’ve decided to use the outdated R6 rig instead of R15? :slight_smile:

I have played roblox for quite a long time and I have seen two of my favorite games having r6 height system, I was very interested into it as it itself is unique considering that most of the games nowadays will never implement it. Making r6 fully customizable height system is just something I decided upon after being influenced and motivated by two of the games which I enjoyed and spent so much time in. On top of that, it’s easier to work with R6 than R15 for me in some terms but this isn’t always the case. Just like now, me having difficulties with R6 height system, especially the head which is dislocating from it’s body for some specific reason and still having issues.

So where are you setting the weld point of the head? Is it being set at the top surface of the torso and the bottom surface of the head as the neck joint, or is it being fixed somewhere else causing the head to animate strangely?

I’m not too sure about the first one, but the second formula is possibly this that I did > body height and half the head height, but when I use that formula for the C0 and C1 it does not work as intended and instead breaks

Your body weld position should be at
body position + 1/2 the body height

Your head weld position should be at
head position - 1/2 the head height

So, C0 is body weld position and C1 is the head weld position? Or, is body weld position for the other motor6D’s that are for the body?

I haven’t worked with scripted welds much. Try it that way and if it doesn’t work, make the C0 the head and C1 the body.

Remember that all the Motor6Ds are for their individual joints, they’re not all welded at the same position. Each Motor6D in the body must be offset to that joint’s position.

Oh, alright. Thank you a lot lol. I was wondering why C0 and C1 is so different and have different reaction to the script itself. I’ll try it out pretty soon and I’ll tell you if it works!

1 Like

I tried it, but I am either dumb or I am just really bad at understanding it. I tried with 2 methods.
First Method:

				motor.C0 = CFrame.new(Head.Position + HeadVector / 2)
				motor.C1 = CFrame.new(character:GetExtentsSize() + Vector / 2)

Second Method:

				motor.C0 = CFrame.new(Vector3.new(Head.Position.X,Head.Position.Y,Head.Position.Z))
				motor.C1 = CFrame.new(Vector3.new(Torso.Position.X,Torso.Position.Y,Torso.Position.Z))

Third Method:

				motor.C1 = CFrame.new(Head.Position - Vector3.new(0,Head.Position.Y / 2,0))
				motor.C0 = CFrame.new(Torso.Position + Vector3.new(0,Torso.Position.Y / 2,0)) 

First Method’s results:
image

Second Method’s results:
image

Third Method’s results:
image

The first and third method looks completely unstable and doesn’t look like the right method, but the second one is the closest to a original one, but the head itself dislocates itself from the body whenever I am moving or the idle is playing. I am not sure if that’s even the correct formula, considering that I don’t know what exactly u mean by body height and most importantly body position. The only way I know to get “body position” is by GetExtentsSize() and nothing else, unless we are talking about Torso itself which is what I went with. I’m not sure, tell me if even any of the formulas are correct or even close to being correct.

When the Torso is resized, get the Y value of that size, then divide it by 2 and offset the weld C0 (or C1) that Y/2 value towards the head.
Same with the head, you need it to be at the bottom surface of the head. Take the height (Y dimension) of the head and then calculate Y/2. Offset the weld C0 or C1 from the center of the head to the bottom surface by the Y/2 value.
Now connect your Motor6D to those C0 and C1s.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.