collision fix
@@ -104,17 +104,17 @@ class Collider
104
104
//CHECK FROM OBJ PERSPECTIVE
105
105
var points =
106
106
[
107
[this.gameObject.transform.position.x - hw, this.gameObject.transform.position.y - hh], // topleft
108
[this.gameObject.transform.position.x + hw, this.gameObject.transform.position.y - hh], // topright
109
[this.gameObject.transform.position.x - hw, this.gameObject.transform.position.y + hh], // bottomleft
110
[this.gameObject.transform.position.x + hw, this.gameObject.transform.position.y + hh] // bottomright
107
this.gameObject.transform.position.x - hw,
108
this.gameObject.transform.position.x + hw,
109
this.gameObject.transform.position.y - hh,
110
this.gameObject.transform.position.y + hh
111
111
];
112
112
113
if (points[0][0] >= o2.transform.position.x - ohw && points[0][0] <= o2.transform.position.x + ohw ||
114
points[0][1] >= o2.transform.position.x - ohw && points[0][0] <= o2.transform.position.x + ohw)
113
if (points[0] >= o2.transform.position.x - ohw && points[0] <= o2.transform.position.x + ohw ||
114
points[1] >= o2.transform.position.x - ohw && points[0] <= o2.transform.position.x + ohw)
115
115
{
116
if (points[2][0] > o2.transform.position.y - ohh && points[0][0] <= o2.transform.position.x + ohh ||
117
points[2][1] >= o2.transform.position.y - ohh && points[2][0] <= o2.transform.position.y + ohh)
116
if (points[2] > o2.transform.position.y - ohh && points[2] <= o2.transform.position.y + ohh ||
117
points[3] >= o2.transform.position.y - ohh && points[2] <= o2.transform.position.y + ohh)
118
118
{
119
119
hit = true;
120
120
}
@@ -104,17 +104,17 @@ class Collider104
//CHECK FROM OBJ PERSPECTIVE104
//CHECK FROM OBJ PERSPECTIVE105
var points =105
var points =106
[106
[107
[this.gameObject.transform.position.x - hw, this.gameObject.transform.position.y - hh], // topleft107
this.gameObject.transform.position.x - hw,108
[this.gameObject.transform.position.x + hw, this.gameObject.transform.position.y - hh], // topright108
this.gameObject.transform.position.x + hw,109
[this.gameObject.transform.position.x - hw, this.gameObject.transform.position.y + hh], // bottomleft109
this.gameObject.transform.position.y - hh,110
[this.gameObject.transform.position.x + hw, this.gameObject.transform.position.y + hh] // bottomright110
this.gameObject.transform.position.y + hh111
];111
];112
112
113
if (points[0][0] >= o2.transform.position.x - ohw && points[0][0] <= o2.transform.position.x + ohw ||113
if (points[0] >= o2.transform.position.x - ohw && points[0] <= o2.transform.position.x + ohw ||114
points[0][1] >= o2.transform.position.x - ohw && points[0][0] <= o2.transform.position.x + ohw)114
points[1] >= o2.transform.position.x - ohw && points[0] <= o2.transform.position.x + ohw)115
{115
{116
if (points[2][0] > o2.transform.position.y - ohh && points[0][0] <= o2.transform.position.x + ohh ||116
if (points[2] > o2.transform.position.y - ohh && points[2] <= o2.transform.position.y + ohh ||117
points[2][1] >= o2.transform.position.y - ohh && points[2][0] <= o2.transform.position.y + ohh)117
points[3] >= o2.transform.position.y - ohh && points[2] <= o2.transform.position.y + ohh)118
{118
{119
hit = true;119
hit = true;120
}120
}