From 6b3f70ab51e5787c37b69be151d622c7458d18fd Mon Sep 17 00:00:00 2001 From: MrGadget <9826063+MrGadget1024@users.noreply.github.com> Date: Fri, 9 Aug 2024 16:48:14 -0400 Subject: [PATCH] fix(TankAuthority): Player pos 1m up --- .../Mirror/Examples/TankTheftAuto/Scripts/TankAuthority.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Assets/Mirror/Examples/TankTheftAuto/Scripts/TankAuthority.cs b/Assets/Mirror/Examples/TankTheftAuto/Scripts/TankAuthority.cs index 81ede6d0b..adf7b8480 100644 --- a/Assets/Mirror/Examples/TankTheftAuto/Scripts/TankAuthority.cs +++ b/Assets/Mirror/Examples/TankTheftAuto/Scripts/TankAuthority.cs @@ -111,8 +111,10 @@ void CmdReleaseControl() // get the regular player object if (connectionToClient.authenticationData is GameObject player) { - // Set pos and rot to match the tank, plus 3m offset to the right - player.transform.SetPositionAndRotation(transform.position + transform.right * 3, transform.rotation); + // Set pos and rot to match the tank, plus 3m offset to the right plus 1m up + // because character controller pivot is at the center, not at the bottom. + Vector3 pos = transform.position + transform.right * 3 + Vector3.up; + player.transform.SetPositionAndRotation(pos, transform.rotation); // set the player object back to the player isControlled = false;