File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed
Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -30,18 +30,10 @@ void Update()
3030 {
3131 if ( Input . GetKeyUp ( KeyCode . Tab ) && ! _isWalking )
3232 {
33- GameController . Instance . enableVisibleMouseColliders ( ) ;
34-
35- Ray ray = Camera . main . ScreenPointToRay ( Input . mousePosition ) ;
36-
37- RaycastHit hit ;
38-
39- if ( Physics . Raycast ( ray , out hit , Mathf . Infinity ) )
33+ if ( Utility . getObjectBelowMouse ( ) . hitSomething )
4034 {
41- EnterHeadCam ( hit . point + Vector3 . up ) ;
35+ EnterHeadCam ( Utility . getObjectBelowMouse ( ) . hitPosition + Vector3 . up ) ;
4236 }
43-
44- GameController . Instance . disableMouseColliders ( ) ;
4537 }
4638 else if ( Input . GetKeyUp ( KeyCode . Tab ) )
4739 {
@@ -82,8 +74,8 @@ public void EnterHeadCam(Vector3 position)
8274 CharacterController cc = _headCam . AddComponent < CharacterController > ( ) ;
8375
8476 cc . radius = 0.1f ;
85- cc . height = 0.5f ;
86- cc . center = new Vector3 ( 0 , - 0.5f , 0 ) ;
77+ cc . height = 0.3f ;
78+ cc . center = new Vector3 ( 0 , - 0.3f , 0 ) ;
8779
8880 _headCam . transform . position = position ;
8981
You can’t perform that action at this time.
0 commit comments