Player gets stuck when ability is activated

Whenever I activate the ability which summons a small ball that enlarges above the character, the player character is stuck on a invisible barrier of some sort. How would I fix this allowing the player to move freely along have the ball follow the player.

local UIS = game:GetService("UserInputService")
local Remote = game:GetService("ReplicatedStorage"):WaitForChild("Remotes").Light.BigLightBall
local debounce = false
local tool = script.Parent or game.StarterPack.Light
local E = false
local plr = game.Players.LocalPlayer
local debris = game:GetService("Debris")
local part = game.ReplicatedStorage.Remotes.Light.LightBall:Clone()
local TweenService = game:GetService("TweenService")
local info = TweenInfo.new(5,Enum.EasingStyle.Sine,Enum.EasingDirection.Out,0,false,0)
local enlarge = TweenService:Create(part,info,{Size = Vector3.new(97.8, 97.8, 97.8)})



Remote.OnServerEvent:Connect(function(plr)
	local Character = plr.Character or plr.CharacterAdded:Wait()

	local weild = Instance.new("WeldConstraint",part)
	
	
	
	local head = Character:WaitForChild("Head")
	weild.Part1 = head
	weild.Part0 = part
	
	part.Parent = workspace or game.Workspace
	
	debris:AddItem(part,10)

	part.Position = head.Position + Vector3.new(0,83,0)
	
	
	enlarge:Play()
	
	
end)

Studio gif : gif

I’m still new to scripting so I hope this isn’t a dumb question.

I hate WeldConstraints.

Your problem isn’t a dumb question, I struggled with this same issue when I was developing a weapon system from scratch.

WeldConstraints combine the mass of everything they’re welded to. And since you are welding the LightBall to the character’s head you’re basically increasing the character’s mass.

image

To fix this, simply make every part that you weld to the player massless. You can change the Massless property under Behavior in the Properties Window.

If this fixes your problem please mark this as the solution. If not, reply and I’ll find another solution that fixes it.

~ Xitral, Game Designer & Lua Programmer

2 Likes