I am creating a Height System for my game in R6, so scaling players is a bit of a hassle. I know this probably involves something related to Motor6D, but I have never used it before, so I don’t really know where to start.
What I currently have:
Desired Effect:
My Current Code:
local PlayerService = game:GetService('Players')
local Character = script.Parent
local Humanoid = Character:FindFirstChild("Humanoid")
local Player = PlayerService:GetPlayerFromCharacter(Character)
characterScale = 1.1
Humanoid.HipHeight += characterScale
Humanoid.HipHeight -= 1
Character["Left Leg"].Size = Vector3.new(Character["Left Leg"].Size.X, Character["Left Leg"].Size.Y * characterScale, Character["Left Leg"].Size.Z)
Character["Right Leg"].Size = Vector3.new(Character["Right Leg"].Size.X, Character["Right Leg"].Size.Y * characterScale, Character["Right Leg"].Size.Z)
local LeftHipMotor = Character.Torso["Left Hip"]
local RightHipMotor = Character.Torso["Right Hip"]
for i, Accessory in pairs(Character:GetChildren()) do
if Accessory:IsA("Accessory") == false then continue end
local AccessoryWeld = Accessory.Handle:FindFirstChild("AccessoryWeld")
if AccessoryWeld ~= nil then
Accessory.Handle.AccessoryWeld.C0 = CFrame.new((Accessory.Handle.AccessoryWeld.C0.Position * characterScale)) * (Accessory.Handle.AccessoryWeld.C0 - Accessory.Handle.AccessoryWeld.C0.Position)
Accessory.Handle.AccessoryWeld.C1 = CFrame.new((Accessory.Handle.AccessoryWeld.C1.Position * characterScale)) * (Accessory.Handle.AccessoryWeld.C1 - Accessory.Handle.AccessoryWeld.C1.Position)
end
end
Thank you for trying to help, but these articles doesn’t really help me a lot a lot. 1st Article is regarding the Head Position, while I’m trying to figure out the Torso Position. 2nd Article is focused on R15, my game is created in R6.
local PlayerService = game:GetService('Players')
local Character = script.Parent
local Humanoid = Character:FindFirstChild("Humanoid")
local Player = PlayerService:GetPlayerFromCharacter(Character)
characterScale = 2
local hum = Character.Humanoid
local torso = Character.Torso
local lleg = Character["Left Leg"]
local rleg = Character["Right Leg"]
lleg.Size = Vector3.new(lleg.Size.X, lleg.Size.Y * characterScale, lleg.Size.Z)
rleg.Size = Vector3.new(rleg.Size.X, rleg.Size.Y * characterScale, rleg.Size.Z)
local llegm6 = torso["Left Hip"]
local rlegm6 = torso["Right Hip"]
llegm6.C1 = CFrame.new(Vector3.new(-0.5,lleg.Size.Y*0.5,0))*CFrame.Angles(0,math.rad(-90),0)
rlegm6.C1 = CFrame.new(Vector3.new(0.5,rleg.Size.Y*0.5,0))*CFrame.Angles(0,math.rad(90),0)
In the future, please refrain from using such toxicity when pointing out errors. Your sarcastic, aggressive comment was completely uncalled for.
Edit: Due to some mesh scaling this may not work on some non-blocky avatars. The scaling (of the legs and the Motor6D offset) may need to change depending on the type of meshes the legs have has.