From b6822691b6b23002f0081fc78357db40306aac83 Mon Sep 17 00:00:00 2001 From: Dal4segno Date: Sat, 17 Jan 2026 00:19:04 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A9=80=ED=8B=B0=ED=94=8C=EB=A0=88=EC=9D=B4?= =?UTF-8?q?=EC=96=B4=20=EC=B9=B4=EB=A9=94=EB=9D=BC=20=EB=8C=80=EC=9D=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 카메라 각도 변경 --- Assets/Scenes/DefenceScene.unity | 4 ++-- Assets/Scripts/Player/PlayerNetworkController.cs | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) 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();