Spawn converted hunters in place and smooth their reveal
Fix the in-place Conversion respawn snapping to the origin (0,0,0), which surfaced when a hider was tagged mid wall-climb. The owner holds authority over the NetworkTransform, so the server's Instantiate position is ignored on the owner. Deliver the tagged world position through a replicated _spawnOverride the server writes in OnNetworkSpawn, and have the owner re-assert it before PlayerCharacterController's first Update snapshots the kill-plane rescue target. This replaces the fragile SpawnedMidSeek phase check. Also hide a freshly converted hunter on other clients for a short settle window (conversionRevealDelay) so nobody sees it pop in or interpolate from the spawn frame; the shot hider is already despawned, then the hunter cleanly materializes in its place. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
24de7ef3da
commit
fe8f12b8bb
2 files changed
+92
-16
No files matched your search
@@ -682,6 +682,11 @@ public class MatchManager : MonoBehaviour
|
||||
current.Despawn(true);
|
||||
|
||||
var go = Instantiate(hunterPrefab, pos, rot);
|
||||
// Hand the tagged world position to the owner: the owner-authoritative transform ignores the server's
|
||||
// Instantiate pos, so without this the converted hunter snaps to the prefab origin (0,0,0). Must be set
|
||||
// BEFORE the spawn so OnNetworkSpawn can push it into the replicated _spawnOverride snapshot.
|
||||
var setup = go.GetComponent<NetworkPlayerSetup>();
|
||||
if (setup) setup.MarkConversionSpawn(pos);
|
||||
go.GetComponent<NetworkObject>().SpawnAsPlayerObject(clientId);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user