So basically i’m trying to create a player customization screen and I need to have the player’s avatar be visible so they can see their changes. However, I would like it so players don’t overlap each other by being teleported to the same place by the server so both avatars are blurred together. Is there a way that I could teleport players to a place but only through the client so there isn’t a giant overlapping issue? Thank you!
Make a separate game for character customization with a 1 player cap
Or, make the customization on the client and have the local players character show make the changes on the server for the player though by sending the information through an event
The best way to handle this is to teleport the player and handle all of the character customization through a local script.
This will make sure there is no overlapping what so ever. To save the customization, you’d have to fire an event to the server so all players can see the new look. Hope this helps!
But if you teleport a player using localscript doesn’t it still translate to being on the server? For example, the game Booga Booga has this problem where the players are overlapping. I think that teleporting via. localscript still affects the server. Please correct me if i’m wrong.
Did a little research for you and you’re correct.
But if you set the Network Ownership of all players to nil on the server, when they teleport locally only they can see where they are. (but you do teleport back if you move as seen in the gif below)
Server Script:
--Server Script
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
repeat wait()
until char.Parent == workspace
char:WaitForChild("HumanoidRootPart"):SetNetworkOwner(nil)
end)
end)
Local Script:
--local script
local Player = game.Players.LocalPlayer
script.Parent.TextButton.MouseButton1Click:Connect(function()
local Character = Player.Character or Player.CharacterAdded:Wait()
Character:SetPrimaryPartCFrame(workspace.Part.CFrame)
end)
This works (sorta?)
https://gyazo.com/e1a04809fe185516247d2d349a1a2cd0
It may be a potential solution that you can workaround. I noticed that anchoring the humanoidrootpart prevent’s the player from teleporting back:
With RootPart Anchored:
https://gyazo.com/37972b40a80169a5c915d8756987cb12
Thanks for this insight. I will play around with this myself and hopefully find some kind of working solution. I think this is the optimal way to teleport players without affecting the server.
So after I move the player by setting network owner to nil how would I make them teleport to the specific location by the server? Anyone know? I just set it back from nil to what? Thanks
The server handles changing the network owner, you can’t do that client-sided.
So pretty much you would grab the CFrame of the specific place you want to teleport the player to and move the Player’s PrimaryPart to that CFrame as shown in the example I did above.
So by teleporting the player by the server we don’t need to reset :SetNetworkOwner() to default and by doing this this will work all across server-wide? Thanks.
Pretty much once the player starts moving again it’ll regain it’s network ownership, so if you’re teleporting a player for character customization your best bet is to anchor them.
I can’t find much information on a better way to do this but as long as you teleport them after setting SetNetworkOwner() to nil. Only they will see the place and no other people.
Try using viewport frames instead of teleporting the player
How would I use viewpoint frames to achieve this? Thanks
My solution would be to clone the player’s character to a different part of the map, lock the camera to the clone’s rootpart and then when the player has finshed customising I belive you would be able to copy the clone’s humanoid description and paste it to the acctual character and reset the camera. I’m not too sure if that last part would work but It’s what I would try first.
Would this be done all locally though?
The camera would have to be handled locally but everything else could be done serversided considering that you are not moving the player’s actual character.
You’re talking about using Viewport right?
No, you would set the camera target to the position of the new character. Also sorry I just realised a mistake with my earlier reply. The booga booga issue of the players clipping would be present in this. I would reccomend using this earlier suggestion.
No thanks, I rather just use Viewport or that SetNetworkOwner to nil suggestion. Thanks though!
Setting NetworkOwner() to nil when tested with 2 players in server doesn’t work for some reason.
This is a very old post I know but for those who are still wandering to no avail (formerly myself included), just anchor your HumanoidRootPart
on server then Pivot the player character model to the wished place on the client using Character:PivotTo(CFrame)