The Curious Case of Tetris Game

Hello,

I’m working on a project of tetris . I rely on the tutorial http://noobtuts.com/unity/2d-tetris-game and seems to work.

Controls work well , the edges too ( were somewhat failing me at the beginning ) but now it happens that when I run the game While not in the parts inside the Grid The spawner in your script says “missing object”

but if I put the pieces within the limits of the grid , the part that generates colque and spawner interact with controls and sometimes overlap ! D:

someone who can help me?

upload caps :slight_smile:

thank you all for your time to read my

Just a random guess,
Maybe you have assigned those groups from scene Hierarchy (and they got destroyed),
should assign them form Prefabs (project) folder, into those spawner fields…

1 Like

I’ll try and notify! :smile: Thanks

Eureka!
if it worked prefab linking a group spawner . but now shows me several Recent Messages in red on the console. Furthermore , it appears that the pieces do not fit together as if they pass near each other not even reach the floor

anyone?

The tutorial has some issues, like not testing if it’s actually looking inside the array. Find the line it’s complaining about by double-clicking the error in the console, and wrap it in a check for the height. It’ll probably require something like:

if(v.y < h)
{
    // Check the grid here
}

I’m not sure about the placement issue. It looks like you’re either putting down the block groups off by 0.5, or have shifted the borders by 0.5. Stick a few Debug.Log() calls here and there to verify that you actually use non-fractional positioning (as the tutorial is designed to do).

1 Like

as part of “//check the grid here” would write ? i dont know, i am beginner… im sorry :confused:

Just put the if-statement around the line with the error. Sandwich that line between the curly braces :slight_smile:

If unsure, post the method causing the problem here.

1 Like

not fit the pieces :frowning:

any idea?..