diff --git a/Assets/Scenes/DefenceScene.unity b/Assets/Scenes/DefenceScene.unity index c67ba53..a2a9836 100644 --- a/Assets/Scenes/DefenceScene.unity +++ b/Assets/Scenes/DefenceScene.unity @@ -3265,11 +3265,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 5356928211000044894, guid: 2b08dd32e48ef5e4aa65a6122099152e, type: 3} propertyPath: FollowOffset.y - value: 3 + value: 5 objectReference: {fileID: 0} - target: {fileID: 5356928211000044894, guid: 2b08dd32e48ef5e4aa65a6122099152e, type: 3} propertyPath: FollowOffset.z - value: -20 + value: -10 objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] diff --git a/Assets/Scripts/Player/PlayerNetworkController.cs b/Assets/Scripts/Player/PlayerNetworkController.cs index 1960435..afb6d2f 100644 --- a/Assets/Scripts/Player/PlayerNetworkController.cs +++ b/Assets/Scripts/Player/PlayerNetworkController.cs @@ -2,6 +2,7 @@ using UnityEngine; using UnityEngine.InputSystem; using Unity.Netcode; using Unity.Netcode.Components; +using Unity.Cinemachine; [RequireComponent(typeof(NetworkObject))] public class PlayerNetworkController : NetworkBehaviour @@ -40,6 +41,18 @@ public class PlayerNetworkController : NetworkBehaviour { if (!IsOwner) return; + // 1. 씬에 있는 가상 카메라를 찾습니다. + // Unity 6에서는 CinemachineVirtualCamera 대신 CinemachineCamera를 주로 사용합니다. + var vcam = GameObject.FindAnyObjectByType(); + + if (vcam != null) + { + // 2. 카메라의 Follow와 LookAt 대상을 '나'로 설정합니다. + vcam.Follow = transform; + vcam.LookAt = transform; + Debug.Log("[Camera] 로컬 플레이어에게 카메라가 연결되었습니다."); + } + _inputActions = new PlayerInputActions(); _inputActions.Player.Jump.performed += ctx => OnJump(); _inputActions.Player.Attack.performed += ctx => OnAttackServerRpc();