Okay, so I’m attempting to make a game that you can drop colored blocks onto a board (kinda like drop 7) and they will combine into the next color in the line (like 2046/threes). The issue comes that have the board rotate and at certain rotations, 180 + 270 on the z axis, the block dropping appears to skip frames. I’ve captured a video here and I’ve attached the code for the block falling animation (even though its not really an animation). Any ideas why the dropping “animation” would be missing when the board is rotated?
IEnumerator FallHandler() {
while (!gameOver) {
if (!boardBkg.getIsRotating()) {
if (Physics.Raycast (transform.position, rayDir, out rayHit, rayDist)) {
int otherColor = rayHit.transform.gameObject.GetComponent<ColorCube> ().getColor ();
if (otherColor == 0 && color != 0) {
rayHit.transform.gameObject.GetComponent<ColorCube> ().setColor (color);
color = 0;
rendColor ();
} else if (otherColor == color && otherColor != 0 && insertLineLoc <= 0 && color != 0) {
rayHit.transform.gameObject.GetComponent<ColorCube> ().upColor ();
color = 0;
rendColor ();
}
}
if (insertLineLoc == 5 && color == 0) {
randColor();
}
yield return new WaitForSeconds(waitTime);
} else {
yield return new WaitForSeconds(waitTime);
}
}
}