Welding parts makes player movement shaky

Custom player part glitching when moving.

local TriangleModule = require(game.ServerScriptService.TriangleModule)
local triangleModel = game.ServerStorage.Triangle
local player
local character
local triangle
local hitbox

game:GetService("PhysicsService"):RegisterCollisionGroup("Player")
game:GetService("PhysicsService"):RegisterCollisionGroup("NoCollisionPart")
game:GetService("PhysicsService"):CollisionGroupSetCollidable("Player", "NoCollisionPart", false)
game:GetService("PhysicsService"):CollisionGroupSetCollidable("NoCollisionPart", "NoCollisionPart", false)
game:GetService("PhysicsService"):CollisionGroupSetCollidable("Player", "Player", false)

function PlayerAdded(plyr)
	player = plyr
	plyr.CharacterAdded:Connect(CharacterAdded)
	TriangleModule.Respawn(player)
end

function CharacterAdded(char)
	task.wait(0.5)
	character = char
	character.Humanoid.Died:Connect(function()
		TriangleModule.Respawn(player)
	end)
	CreateTriangle()
	SetupPlayer()
end

function CreateTriangle()
	triangle = triangleModel:Clone()
	triangle.Parent = character.HumanoidRootPart
	triangle.CFrame = character.HumanoidRootPart.CFrame
	triangle.Name = "Triangle"
	triangle.CanCollide = true
	triangle.UsePartColor = true
	triangle.Massless = true
	
	triangle.Color = Color3.new(math.random(0, 255), math.random(0, 255), math.random(0, 255))
	
	local weld = Instance.new("WeldConstraint", triangle)
	weld.Part0 = character.HumanoidRootPart
	weld.Part1 = triangle
	
	hitbox = Instance.new("Part", triangle)
	hitbox.Name = "Hitbox"
	hitbox.Size = Vector3.new(2, 2, 2)
	hitbox.CanCollide = false
	hitbox.Transparency = .5
	hitbox.CFrame = triangle.CFrame
	hitbox.Massless = true
	
	local weld2 = Instance.new("WeldConstraint", hitbox)
	weld2.Part0 = triangle
	weld2.Part1 = hitbox
	
	local size = Instance.new("NumberValue", triangle)
	size.Name = "SizeInt"
	size.Value = 8
	
	character.Humanoid.WalkSpeed = 50
	
	triangle.PlayerUI.PlayerLabel.Text = player.Name
	triangle.PlayerUI.SizeLabel.Text = "Size: ".. tostring(math.floor(size.Value*100, 0.5))
	triangle.PlayerUI.SpeedLabel.Text = "Speed: ".. tostring(math.floor(player.Character.Humanoid.WalkSpeed*100, 0.5))
end

function SetupPlayer()
	for _, child in ipairs(character:GetChildren()) do
		if child:IsA("Accessory") then
			child:Destroy()
		end
		if child:IsA("BasePart") then
			child.Transparency = 1
			child.CollisionGroup = "Player"
			
			if child.Name == "Head" then
				child:FindFirstChildOfClass("Decal"):Destroy()
			end
			if child.Name == "Left Arm" then
				child:Destroy()
			end
			if child.Name == "Right Arm" then
				child:Destroy()
			end
		end
		
		hitbox.CollisionGroup = "Player"
		triangle.CollisionGroup = "Player"
		game.Players.CharacterAutoLoads = false
		player.CameraMaxZoomDistance = 20
		player.CameraMinZoomDistance = 20
		character.Humanoid.HipHeight = 0
	end
end


game.Players.PlayerAdded:Connect(PlayerAdded)

5 Likes

By glitching I’m guessing you mean the shaking

Try setting the hip height to be 0.01 or something lower

2 Likes

Thanks for your reply but it didn’t work still having the same issue any other thoughts?

1 Like

You can turn cancollide of the triangle off

1 Like

I need can collide on or ill fall through the floor.

1 Like

If the triangle is a model set the scale of it to 1

1 Like

And set hip height higher if that doesn’t work

1 Like

The triangle progressively gets bigger so the scale cannot be a important factor, the collision needs to be on or else half the triangle will be in the floor.

1 Like

You can then just set the triangle inside the models size to be bigger, no?

1 Like

No the model is my player and you cant scale a player model like that, also the triangle is what’s getting bigger not the model.

1 Like

Yh so when it does get bigger resize triangle instead of model

1 Like

Try setting hip height higher first

1 Like

Didn’t work & I’m not resizing model.

1 Like

keep setting it higher until it does then

Also make massless of the triangle on

Hip height didn’t affect it.

dont change the hipheight at all in ur script, try that