Skip to content

Commit 306b565

Browse files
committed
Fix for alpha 4
1 parent 79f56f9 commit 306b565

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

PeepCam/PeepCam.cs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)