"Invisible ceiling" prevents jumping with my modified character

After adjusting characters with a script, an “invisible ceiling” seems to prevent me from jumping under low ceilings even when there’s a few units of space above them. Walking underneath works fine, however.

I know for a fact that it’s not the fault of my custom ControlScript. The problem persists even when I cut it.

The script that adjusts characters is named “Players” and is located in ServerScriptService.
It looks like this:

local Players = game:GetService("Players")
local Physics = game:GetService("PhysicsService")
local Debris = game:GetService("Debris")

local function onCharacterAdded(character,player)
	--We're alive now
	player:SetAttribute("Alive",true)
	
	--rootPart stuff
	--I'm having the rootPart handle all world collisions so that it's smoother
	local rootPart = character:WaitForChild("HumanoidRootPart")
	-- Wait until rootPart is part of the workspace		
	while not rootPart:IsDescendantOf(workspace) do
		wait()
	end
	--rootPart:SetNetworkOwner(game.Players:GetPlayerFromCharacter(character))
	rootPart.CustomPhysicalProperties = PhysicalProperties.new(0.7, 0, 0, math.huge, math.huge)
	rootPart.Shape = "Ball"
	rootPart.Size = Vector3.new(4,4,4)
	rootPart.CanCollide = true
	rootPart.CanTouch = true
	rootPart.Transparency = 1
	Physics:SetPartCollisionGroup(rootPart,"PlayerRootParts")
	
	--Adjust body parts
	local Torso = character:WaitForChild("Torso")
	local Left_Leg = character:WaitForChild("Left Leg")
	local Right_Leg = character:WaitForChild("Right Leg")
	local Left_Arm = character:WaitForChild("Left Arm")
	local Right_Arm = character:WaitForChild("Right Arm")
	local Head = character:WaitForChild("Head")
	Head.Size = Vector3.new(1.25,1.25,1.25)
	Head.Mesh.Scale = Vector3.new(1,1,1)
	
	Physics:SetPartCollisionGroup(Torso,"PlayerLimbs")
	Physics:SetPartCollisionGroup(Left_Leg,"PlayerLimbs")
	Physics:SetPartCollisionGroup(Right_Leg,"PlayerLimbs")
	Physics:SetPartCollisionGroup(Left_Arm ,"PlayerLimbs")
	Physics:SetPartCollisionGroup(Right_Arm,"PlayerLimbs")
	Physics:SetPartCollisionGroup(Head,"PlayerLimbs")
	
	--These aren't meant to trigger anything
	Torso.CanTouch = false
	Left_Leg.CanTouch = false
	Right_Leg.CanTouch = false
	Left_Arm.CanTouch = false
	Right_Arm.CanTouch = false
	Head.CanTouch = false
	
	--bbox establishment, for collisions with projecitles and to grab pickups
	--not really a box
	local BBox = Instance.new("Part")
	BBox.Shape = "Cylinder"
	BBox.Transparency = 1
	BBox.Name = "BBox"
	local temp = Vector2.new(4,1).Magnitude
	BBox.Size = Vector3.new(5,temp,temp)
	BBox.Massless = true
	BBox.Parent = character
	Physics:SetPartCollisionGroup(BBox,"BBox")
	
	local boxCon = Instance.new("Motor6D")
	boxCon.Name = "BBox Connector"
	boxCon.MaxVelocity = 0.1
	boxCon.Parent = rootPart
	boxCon.Part0 = rootPart
	boxCon.Part1 = BBox
	
	BBox.Position = rootPart.Position + Vector3.new(0,-0.5,0)
	BBox.Orientation = Vector3.new(0,0,90)
	BBox.CanTouch = true
	
	--Humanoid stuff
	local humanoid = character:WaitForChild("Humanoid")
	humanoid.HealthDisplayType = "AlwaysOff"
	humanoid.HipHeight = -1
	humanoid.MaxHealth = 200
	humanoid.Died:Connect(function()
		player:SetAttribute("Alive",false)
		
		--So we can't bump into dead people
		Debris:AddItem(rootPart,0)
		--So we can't grab stuff when we're dead
		Debris:AddItem(BBox,0)
		
		Physics:SetPartCollisionGroup(Torso,"PhysProps")
		Physics:SetPartCollisionGroup(Left_Leg,"PhysProps")
		Physics:SetPartCollisionGroup(Right_Leg,"PhysProps")
		Physics:SetPartCollisionGroup(Left_Arm ,"PhysProps")
		Physics:SetPartCollisionGroup(Right_Arm,"PhysProps")
		Physics:SetPartCollisionGroup(Head,"PhysProps")
	end)
end

local function onPlayerAdded(player)
	player.CharacterAdded:Connect(function(character)
		onCharacterAdded(character,player)
	end)
	player:SetAttribute("Alive",false)
end

Players.PlayerAdded:Connect(onPlayerAdded)

I tested and this is due to the humanoidrootpart extending above the head.
I suspect this is due to roblox’s internal jump height calculation which expects the humanoidrootpart to have exactly the same size and position as the torso.

1 Like

Ah darn, guess I can’t really change that. Thankfully I’ve just thought of a workaround. I don’t have to use the rootPart, even if it would be tidier. I can just make another part and attach it.