[Solved] Rubik’s cube Unity 5 [closed]


Your question is not very clear. Even if English isn’t your first language, code is international. Please try to post what you’ve done so far. We don’t know if you can render your cube, how the objects are organised or how they should be animated.

In short, you will need to complete at least some of the following:

  • Render a button on screen using uGUI Buttons.
  • Add a click handler to the button.
  • In the click handler, update some variables/model/similar with the new positions.
  • Animate the cube to reflect the new positions.
  • Either rotate the camera around the cube or rotate the cube and background together.

Unless you provide more information, that’s the best answer we can give you.

Re Comments:

Have a variable called locked that keeps track of if we’re locked or not. Have a function to toggle it. Wire the “Locked” button up to ToggleLocked

private bool locked = false;

public void ToggleLocked() {
    locked = !locked;
}

And then in your button methods, check if we’re locked before doing anything…

public void SomeButtonClicked() {
    //check if we're locked
    if(!locked) {
        //If not, do something
    }
}

2

solved Rubik’s cube Unity 5 [closed]