You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I want to weld a ball to a player using a motor6d when they touch it.
What is the issue? Include screenshots / videos if possible!
Whether the motor6d has a part0/part1 etc, as long as it is in the character of the player, the player freezes in every other clients screen. What I mean by this is basically, when someone gains possession of the ball on their screen nothing changes but on everyone elses screen the players character stops moving completely, although on the first client AND server, the position is updating.
What solutions have you tried so far? Did you look for solutions on the Creator Hub?
Searching/experimenting
This post explains my problem but it has no solution
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
-- This is an example Lua code block
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
first of all, every player would need to have ownership of the ball, which isnt possible
secondly making the ball massless wouldnt work because im making a soccer game, and i need physics. toggling it isnt worth it as you’re supposed to get slowed down with the ball anyways
that doesn’t fix it. basically, the motor6d makes the player stop rendering for others because they dont have ownership of the character itself
lets say im player 1, and player 2 has the ball
once he gets the ball, the ownership is either player or server
but not mine
also, this happens as soon as I insert a motor6d.
what i mean by this is its not because of the ball; having a motor6d inside of a character makes it stop rendering for every player who does not have network ownership over it
by give ownership of their character do you mean giving each player ownership of their own character? (set root priority of ball to -127 and it didnt work btw)
at this point since im pretty sure this is an engine bug i might just use heartbeat or a loop and change the position of player on each client locally aswell
Did you edited the character on a client?
That literally what caused that.
You made it impossible for other player (visually) for specific client to gain ownership of a ball.
Just do so on server and it will be fine.
i didnt, what i mean is basically im gonna try to send the real position of the player from the server to each client and they will update the position on their screens
That not even barebones;
That 100% unplayable.
Double replication of a character is a nightmare.
Just set. the ball. that. player. grabs. to. have. network. owner. of player. that. is. carrying. it.
OK?
local getBall = coroutine.create(function()
while task.wait() do
if BALL:WaitForChild("InPossession").Value == false and BALL:WaitForChild("CanSteal").Value == true then
local nearParts = workspace:GetPartBoundsInRadius(BALL.Position, 6)
for index, nearPart in pairs(nearParts) do
if nearPart.Name == "HumanoidRootPart" then
BALL.Parent = nearPart.Parent
local motor6D = Instance.new("Motor6D")
motor6D.Name = "Ball"
motor6D.Part0 = nearPart
motor6D.Part1 = BALL
motor6D.Parent = nearPart
BALL:WaitForChild("PossessorName").Value = nearPart.Parent.Name
BALL:WaitForChild("InPossession").Value = true
BALL:SetNetworkOwner(game:GetService("Players"):GetPlayerFromCharacter(nearPart.Parent))
break
end
end
end
end
end)
coroutine.resume(getBall)
just did, heres the segment of a script. bug isnt fixed
Consider caching variables for perfomance btw.
You sure that it returns a player and not nil?
Go to ALT+S → Physics → Are Owners Shown → true
Ball must have a green outline if player owns it
local getBall = coroutine.create(function()
while task.wait() do
if BALL:WaitForChild("InPossession").Value == false and BALL:WaitForChild("CanSteal").Value == true then
local nearParts = workspace:GetPartBoundsInRadius(BALL.Position, 6)
for index, nearPart in pairs(nearParts) do
if nearPart.Name == "HumanoidRootPart" then
--BALL.Parent = nearPart.Parent
local motor6D = Instance.new("Motor6D")
motor6D.Name = "Ball"
motor6D.Part0 = nearPart
--motor6D.Part1 = BALL
motor6D.Parent = nearPart
BALL:WaitForChild("PossessorName").Value = nearPart.Parent.Name
BALL:WaitForChild("InPossession").Value = true
--BALL:SetNetworkOwner(game:GetService("Players"):GetPlayerFromCharacter(nearPart.Parent))
break
end
end
end
end
end)
coroutine.resume(getBall)
here i do nothing with the ball, i simply add a motor6d
but the same thing happens
also i checked and none of my local scripts set a cframe/position or other important property aside from camera parts