I am currently scripting a simple magic system. I’ve come across an issue where if you weld an object (yes, it is unanchored) to a player, it will freeze in place for a second or two before unfreezing. Is there a possible fix to this?
This is the snippet of code for the ability:
local Sphere = Instance.new("Part", Player.Character.HumanoidRootPart)
Sphere.Shape = Enum.PartType.Ball
Sphere.Material = Enum.Material.ForceField
Sphere.BrickColor = BrickColor.new("Institutional white")
Sphere.CanCollide = true
Sphere.Anchored = false
Sphere.Name = "Shield"
Sphere.Position = Player.Character.HumanoidRootPart.Position
Sphere.Size = Vector3.new(0.1, 0.1, 0.1)
local WeldConstraint = Instance.new("WeldConstraint", Player.Character.HumanoidRootPart)
WeldConstraint.Part0 = Player.Character.HumanoidRootPart
WeldConstraint.Part1 = Sphere
TweenService:Create(Sphere, Info, { Size = Vector3.new(7, 7, 7) }):Play()
Player.Character.TempData.Invincible.Value = true