Wierd teleporting with wields

Hello,

There’s an attack in my game that your character can use, however it looks like they teleport when they use it.

The attack is summoning an orb that drags nearby enemies to it, and while the character is summoning the orb there’s a weld put on the HumanoidRootPart connecting it to the orb. When this happens, on the server side, the character seems to freeze in place for the duration of the “charge-up”, and then the character just teleports to wherever they moved to on their client

what it looks like on other players’ screens
what it looks like on the client’s screen

Here is the chunk of the script that adds the weld:

local char = p.Character --- "p" is a variable for player

local ball = Instance.new("Part")
local weld = Instance.new("Weld")

ball.Parent = char
ball.CanCollide = false
ball.Massless = true
ball.Size = Vector3.new(0,0,0) -- it starts off at this size but later grows
ball.Shape = "Ball"
ball.Color = Color3.fromRGB(83, 67, 124)
ball.Material = Enum.Material.Neon

weld.Part0 = char.HumanoidRootPart
weld.Part1 = ball
weld.C1 = CFrame.new(0,-1.5,4.4)
weld.Parent = char.HumanoidRootPart

I’m not sure if it’s a studio bug or if something I did was wrong.

It looks like its just latency issues.

it happens 100% of the time though, is there any way I could fix it?

Try to use “Motor6D” instead of “Weld”.

I have, but it got the same result

Since the freeze only happens during the charge-up sequence I suspect it has something to do with the fact that you resize the orb.

Can you try to change the size of a sphere mesh instead of the basepart it self?

Is it server sided? Or client sided? Because I’ve had the same problem before when using things like welds on a local script. (Sorry for this question I currently cannot test the code right now.)

The code is in a server script

That worked! Thank you. I never thought of using meshes before for something that isn’t related to building.

this is what it looks like on the server side now

local char = p.Character

ball.Parent = char
ball.CanCollide = false
ball.Massless = true
ball.Size = Vector3.new(0,0,0)
ball.Color = Color3.fromRGB(83, 67, 124)
ball.Material = Enum.Material.Neon
	
local mesh = Instance.new("SpecialMesh",ball)
mesh.MeshType = Enum.MeshType.Sphere

weld.Part0 = char.HumanoidRootPart
weld.Part1 = ball
weld.C1 = CFrame.new(0,-1.5,4.4)
weld.Parent = char.HumanoidRootPart
1 Like