Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Precise Collisions

Discussion in 'Scripting' started by artzfx, Sep 3, 2008.

  1. artzfx

    artzfx

    Joined:
    Apr 28, 2008
    Posts:
    572
    I decided to take a break from my Archviz scenes and make my first little Unity game given all the talk about the iPhone lately.

    The game is a 3DSlidePuzzle http://www.livingartz.com/unity/3DSlidePuzzle2.html

    I am a designer not a coder so the only script from me is a simple Retrict to "0" on the Y-axis script to stop the cubes bouncing out of the blue base.

    I have a few issues with this game.

    1. I have to make the Box Colliders on the white cubes larger than the cubes to prevent the cubes cutting through each other before colliding. See attached image.

    2. If you drag a cube hard enough towards another cube against the sides it will engulf the next cube.

    3. The cubes cut through the side of the blue base which has a Mesh Collider applied to it.

    Each cube has a Box Collider, RigiBody and RetsrictToYaxis script.

    The Main Camera has a DragRigidBody script applied to it.

    By placing Planes with Box Colliders in from the sides of the Blue base I can make the cubes stop from cutting through the blue base, but I would have thought I should not need to resort to this. The game without the Planes http://www.livingartz.com/unity/3DSlidePuzzle.html By doing this it does resolve issues 1 and 3 above.

    If anyone has any ideas about fixing the above issues I would appreciate it.

    Once I prove out the interactivity I will replace the models with cubes that share one textured image that I would like the player to be able to swap out with their own image if that is within the ability of Unity to do so. Then add a button to scramble up the cubes for the start of each game.
     

    Attached Files:

  2. MatthewW

    MatthewW

    Joined:
    Nov 30, 2006
    Posts:
    1,356
  3. artzfx

    artzfx

    Joined:
    Apr 28, 2008
    Posts:
    572
    Cheers Matthew,

    That helps a lot.