Here’s the my 4 colliders. I want to make checkLock (high narrow collider) like a check collider for 3 another colliders (first1, second2, third3). It’s like a puzzle, where all 3 numbers have to be at the top. I’ve tryed to make this through the degrees and rotation, but I’ve got strage results sometimes (-1.4 ). I don’t know why it is so, but if someone explain my why, I’ll be very happy.
So, here’s my code:
public void MoveCircle(string objname)
{
if (Input.GetKeyDown(KeyCode.E)) {
GameObject.Find (objname).transform.Rotate (0, 0, -45);
}
if (Input.GetKeyDown(KeyCode.Q)) {
GameObject.Find (objname).transform.Rotate (0, 0, 45);
}
}
void OnTriggerStay2D (Collider2D other) {
if (other.gameObject.tag == "1") {
MoveCircle("first1");
}
if (other.gameObject.tag == "2") {
MoveCircle("second2");
}
if (other.gameObject.tag == "3") {
MoveCircle("third3");
}
}
How can I make this? I want to make OnTriggerStay2D for checkLock and smth like:
When(first1&&second2&&third3 on checkLock) some variable equals 1. When not - 0.
Hope for you.