more precise door detection
This commit is contained in:
parent
81c3b30ca4
commit
51b7e16bbf
1 changed files with 1 additions and 1 deletions
|
@ -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<Player>();
|
||||
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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue