While using the ForcePlayerPosition method, when a player is moved, as you probably know, the world around them is not immediately populated and it takes a few moments to 'load'.
Is there any way to ensure the landscape/building/etc is loaded and displayed before the player appears?
Can I have their client preemptively load their surroundings before they get there?
I have read that you may want to have the player sleep to aid in in the visual population but that really depends on how quick the player wakes up.
is there a way to know when it's loaded, so that I make force them to remain sleeping or something?
Solved ForcePlayerPosition, scene loading question
Discussion in 'Rust Development' started by carny666, Jan 7, 2016.
-
I know that the m-teleportation plugin gets around this by forcing the player to reload the session data around them.
This is it in LUA:
Code:player:MovePosition(destination); player:ClientRPCPlayer(nil, player, "ForcePositionTo", destination, nil, nil, nil, nil) player:TransformChanged(); player:SetPlayerFlag(global.BasePlayer.PlayerFlags.ReceivingSnapshot, true); player:UpdateNetworkGroup(); player:SendNetworkUpdateImmediate(false); player:ClientRPCPlayer(null, player, "StartLoading", nil, nil, nil, nil, nil); player:SendFullSnapshot();
-
Check the WarpSystem somewhere at the end.. you will find what you need for C#
-
Than you!