Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Making a game from puzzle

Discussion in 'Works In Progress' started by Modulus, Jan 11, 2012.

  1. Modulus

    Modulus

    Joined:
    Jan 11, 2012
    Posts:
    6
    Hi everyone!

    I've decided to make a game of this puzzle:

    http://www.puzzlemaster.ca/browse/wire/metal/1116-cast-quartet

    The puzzle consist of four separate metal pieces and the goal is to separate this pieces from the original assembly seen in the picture and the assembly them back again. I've already made the pieces needed with 3ds MAX and started a new project with unity (I'm not at my home computer now and will share the project when I get home).

    So far I've managed to make the pieces respect the laws of physics by colliding in the right way. I've also found a workable solution that allows the player to view the pieces freely from any angle by the use of Mouse Look script. The next step is to create a interface which allows for the pieces to be moved and rotated freely as if they were in the hands of the player. This step is the one that is causing me headache.

    I understand that scripts are to be used in the completion of this step. I tested the DragObject.js script, but it had limitations that forced me to abandon it. Unless workable scripts that use mouse as the controller are found alternative solution is to use the keyboard to manage the puzzle.

    Thank you for taking your time to look into my project. I hope I'll find the help I need from here :)

    Best regards,

    Modulus
     
  2. henry96

    henry96

    Joined:
    Sep 28, 2011
    Posts:
    582
    Can't wait to see these concept in action. :)
     
  3. Modulus

    Modulus

    Joined:
    Jan 11, 2012
    Posts:
    6
    Hi again!

    As promised here is the project:

    View attachment $Cast Quartet Puzzle.rar

    The next step I need to complete is the following:

    1. Click on any of the four GameObjects named Piece A_1, Piece A_2, Piece B_1, Piece B_2 to select and highlight it.
    2. Move the selected object freely with the mouse or keyboard along its X, Y and Z axes.
    3. Click on empty space to deselect the currently selected piece.

    This is the current simple problem I'm working with :)

    If someone is nice and can offer some help, please feel free to do so!

    Thanks.

    Modulus
     
  4. Modulus

    Modulus

    Joined:
    Jan 11, 2012
    Posts:
    6
    To clarify a bit more. My ultimate goal is to be able to control the pieces in a fashion similar to that of 3ds MAX viewports pan, zoom and rotate. Should be doable I suppose.
     
  5. wccrawford

    wccrawford

    Joined:
    Sep 30, 2011
    Posts:
    2,038
    So when you click on a piece, I assume you want the 3 axis arrows to appear so people can drag those arrows? Or did you have something else in mind?

    I'm not sure how you'd do that from the keyboard, either, except possibly either limiting to 2d at any given time, or mapping 6 keys, 2 per axis for up and down on the axis.

    This seems like an interesting, yet fairly easy, project, and if nobody with more skill wants it, I'd be happy to play with it and see if I can make it work.

    My only other concern is that these kind of puzzles generally require a trick and making that happen in a virtual environment might be too much.
     
  6. Modulus

    Modulus

    Joined:
    Jan 11, 2012
    Posts:
    6
    Hi wccrawford and thank you for your reply. If you can make the axis arrows appear that would be a nice bonus and would add to the ease-of-use of the interface, but it's not necessary for the game to work properly. The goal is only to be able to move the pieces along the axes freely right now. Latter a new property should be added that allows the user to rotate the pieces in a way similar to the moving.

    Your proposed solution to the keyboard interface was what I had in mind as well. My experience unfortunately doesn't allow me to accomplish this at the moment. But as I said earlier it's not required to move the pieces with the keyboard if a more efficient solution is to use the mouse. The solution of this puzzle won't in my knowledge require any tricks. It's all about moving and rotating the pieces in the right order that gets it solved.

    I appreciate your help and it would be really cool to get this thing working :)

    Cheers,

    Modulus
     
  7. wccrawford

    wccrawford

    Joined:
    Sep 30, 2011
    Posts:
    2,038
    I think it could be interesting to try to make this work, so I'll DL it when I get home and give a shot at making it work as you described.
     
  8. wccrawford

    wccrawford

    Joined:
    Sep 30, 2011
    Posts:
    2,038
  9. Modulus

    Modulus

    Joined:
    Jan 11, 2012
    Posts:
    6
  10. wccrawford

    wccrawford

    Joined:
    Sep 30, 2011
    Posts:
    2,038
    Good to hear! I tried to load up the project in Unity 3.4 and it failed to upgrade the project, and then crashed. So I can't do anything with it.

    I'm glad that gizmo will do it instead, though!