• Advertisement
  • Popular Tags

  • Popular Now

  • Advertisement
  • Similar Content

    • By wobbegong_
      I am taking an absolute beginner's game development course and we have just finished game jams in small groups. Our current assignment is to get feedback from people working in any aspect of game development. I would very much appreciate any feedback! The game is up on itchi.io (sound warning) https://wobbegong.itch.io/zombie-shooter It's essentially a very basic PvE.
      I also have some things I'm wondering about, but you don't necessarily have to answer these. 
      1. Do you have any tips on working with physics? My group wrestled a bit with Rigidbody physics not totally working the way we wanted to -- jumping ended up kind of floaty and inclines seem to mess up movement. Alternatively... how can I build terrains with depth that won't result in wonky physics?
      2. How can I keep up the level of challenge in an interesting way as the player progresses through the waves?
      3. What are some of your personal guidelines for creating title screens?
      Thank you very much in advance!
    • By ethancodes
      I'm having a weird issue with detecting a collision. I've tried everything I could find online but nothing seems to work. I have a brick object. It has a 2D Collider attached and I have also attached a 2D Rigidbody on it. I also have an EndScreen 2D Collider. The EndScreen 2D collider is tagged with "EndScreen". I am trying to detect when a brick collides with the end screen collider and simply print "game over" in the console. 
      This is my current code for this part of the program, it is attached to the bricks:
      void OnCollisionEnter (Collision2D collision) { if (collision.gameObject.tag == "EndScreen") { Debug.Log("Game over"); } } Several things have happened depending on the set up. If I have the rigidbody 2D set as static, my ball object can still collide with the bricks, but I get no Log message. If I set it to Kinematic or Dynamic, I get absolutely no interaction between the ball and the bricks, and nothing when the bricks pass through the collider. I have tried to set the collider to a trigger and use OnTriggerEnter2D, no change. I have tried to put the rigidbody on the EndScreen object and tried to set it's body type to all 3 settings, no change. The only thing I can think of that I have not done is put the script on the EndScreen object and switch the tag to the bricks. The reason I have not done this is because I will have several types of bricks, some of which will have different tags. 
       
      Please tell me somebody can see what I'm doing wrong here, because I'm losing my mind over something I feel should be ridiculously simple. Thanks.
    • By Sandman Academy
      Downloadable at:
      https://virva.itch.io/sandman-academy
      https://gamejolt.com/games/sandmanacademy/329088
      https://www.indiexpo.net/en/games/sandman-academy
      https://www.gamefront.com/@sandmanacademy
      http://www.indiedb.com/games/sandman-academy
    • By Sandman Academy
      Downloadable at:
      https://virva.itch.io/sandman-academy
      https://gamejolt.com/games/sandmanacademy/329088
      https://www.indiexpo.net/en/games/sandman-academy
      https://www.gamefront.com/@sandmanacademy
      http://www.indiedb.com/games/sandman-academy
    • By Sandman Academy
      Downloadable at:
      https://virva.itch.io/sandman-academy
      https://gamejolt.com/games/sandmanacademy/329088
      https://www.indiexpo.net/en/games/sandman-academy
      https://www.gamefront.com/@sandmanacademy
      http://www.indiedb.com/games/sandman-academy
  • Advertisement
  • Advertisement
Sign in to follow this  

Unity Help with unity

This topic is 441 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello colleagues, I'm new to this area and am having a concert difficulty a bug.
 
I'm creating a tetris-style game, but I'm having trouble building pieces.
 
Thus, when the piece collides with the ground it generates a normal piece, but when the piece collides with another piece it generates several other pieces and ends up locking the unity '-'
 
I'll post some pictures showing the game and the piece of code I made.
 
Can anybody help me. 

Share this post


Link to post
Share on other sites
Advertisement

Your pictures show blocks that are not exactly aligned with the columns and rows.  That leads to various problems.

 

 

when the piece collides with another piece it generates several other pieces and ends up locking the unity
 

 

I'm not entirely sure what you mean by that.

 

Some games in the genre have the pieces remain as blocks, if you clear a row and that leaves blocks with a hole below, the blocks will fall if they can.

 

Some games in the genre, including the original, have the blocks change form into the row. Once it locks in place the four blocks of the tetromino enter an array for the row they're in and they no longer move individually.

 

Either way, when the entire row is full the row is removed.

Share this post


Link to post
Share on other sites

but when the piece collides with another piece it generates several other pieces and ends up locking the unity '-'


When Unity locks up it's almost always because you have an infinite loop or infinite recursion in your code. Step through it in a debugger and you should be able to see where it's looping. Edited by Nypyren

Share this post


Link to post
Share on other sites

Your OnTriggerEnter2D() is called for both pieces at the same time when they collide.

The spawner then spawns two pieces at the same time which instantly collide again and the cycle keeps repeating.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement