Reworked collision detection so it doesn't break if the mouse moves too fast and cleaning items don't sproadically shake when collision gets funky

This commit is contained in:
Gregory Campbell
2020-06-05 14:49:25 -04:00
parent b51124c1b4
commit fd0aa415da
5 changed files with 11 additions and 11 deletions
+2 -2
View File
@@ -10,7 +10,7 @@ public class DirtScript : MonoBehaviour
private int wiped = 0;
Color tmp;
void OnCollisionEnter2D(Collision2D other){
void OnTriggerEnter2D(Collider2D other){
if(other.gameObject.name == "SprayBottle" && !sprayed)
{
@@ -20,7 +20,7 @@ public class DirtScript : MonoBehaviour
}
void OnCollisionExit2D(Collision2D other){
void OnTriggerExit2D(Collider2D other){
tmp = this.GetComponent<SpriteRenderer>().color;
+1 -1
View File
@@ -8,7 +8,7 @@ public class SprayScript : MonoBehaviour
private int wiped = 0;
Color tmp;
void OnCollisionExit2D(Collision2D other){
void OnTriggerExit2D(Collider2D other){
tmp = this.GetComponent<SpriteRenderer>().color;