From 51b7e16bbfa05b6e97825dd0e639bf03d39fb949 Mon Sep 17 00:00:00 2001 From: Saibotk Date: Tue, 24 Apr 2018 20:35:31 +0200 Subject: [PATCH] more precise door detection --- Assets/Scripts/Door.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/Scripts/Door.cs b/Assets/Scripts/Door.cs index 7ab0529..9c9d296 100644 --- a/Assets/Scripts/Door.cs +++ b/Assets/Scripts/Door.cs @@ -85,7 +85,7 @@ public class Door : MonoBehaviour { // TODO only works correct for entering a room! if ( collision.tag == "Player") { Player player = collision.gameObject.GetComponent(); - Vector3 colliderToPlayer = player.gameObject.transform.position - ( gameObject.transform.position - (Vector3) (0.6f * (Vector2) toOuter)); + Vector3 colliderToPlayer = player.gameObject.transform.position - ( gameObject.transform.position - (Vector3) (1f * (Vector2) toOuter)); float angle = Vector2.Angle(toOuter, colliderToPlayer); if ( angle < 90) {