Hello, Im Making an Obby About 2 Player in 1 Character, And Everything has been going well so far, 1 player is in control of movement and 1 is in control of Jumping
–how my script works summarized >_>
Im pretty uh noobie at scripting so i didnt use any advanced technique to do it but how i did it is, the mover actually controls the character and the jumper character is immobilized somewhere else and his camera subject is the mover’s character, the mover cannot jump but the jumper when press space will make the mover character jump, and it works, the timing is also good, like when i press space as a jumper , the mover character jump immidietly without any delay, But theres a problem
Edit : The left is the mover, the right is the jumper <_<
As you can see , when i as the jumper press space, the mover jump exactly in time but in jumpers POV , the jump is delayed, laggy or choppy, and when the mover moves, the jumper POV sees it as choppy as well, it still work as intended but the choppyness will reduce user performance cuz timing is needed for this 2 player obby >_>
–Solution i try
I Searched about this SetNetworkOwner() and tried it, but it went uh, wrong as the character was unable to move, i wont show the entire script cuz it messy and you’ll probably vomit of how spaghetti code it is lol but heres the important part
if x >= 2 then --if both are ready
tp = CharModel:Clone() -- clone their character
tp.Parent = game.Workspace
local phum = tp:FindFirstChild("Humanoid") -- their character hmanoid
local phumroot = tp:FindFirstChild("HumanoidRootPart") -- their character root part
for _,plr in pairs(PlrService:GetChildren()) do -- get both player, random mover / jumper
if m == nil then -- if mover isnt taken then ok
m = plr
plr.Character = tp -- the mover OWNS the character
else
j = plr -- if mover is taken then plr be jumper
phumroot:SetNetworkOwner(plr) -- If this line not exist it works but choppy, tried this but not work
end
end
SRole:FireClient(m,0,phum) -- just informs the mover they mover
SRole:FireClient(j,1,phum) -- just informs the jumper that they jumper
end
Im not really advanced coder but i want this to work, can anyone tell me what Possible way or possible method i can try, you dont exactly have to try me to send the code and you fix everything but helping me find a method that can be a solution would help a lot <3