playMaker

Author Topic: How to rotate cube to 'tip' it?  (Read 1668 times)

jess84

  • Hero Member
  • *****
  • Posts: 515
How to rotate cube to 'tip' it?
« on: April 07, 2014, 12:26:55 PM »
I can't seem to work this out properly, after a couple of hours playing with HOTween actions and settings...

What I want to do, is tip over a cube - think of it as a dice being tipped from 6 being on top, to 3 being on top - and the dice has therefore moved one width position to the side.

This seems to be more tricky than I first thought. My pivot point of my cube is central, and my cubes are children of a containing empty gameobject. (this added together has foiled me so far).

Shouldn't this be simple?

I couldn't even set the value of my Rotation X to -90 with set property, as it would somehow set it to 180 and change one of the other axis' too!

*sigh*


Breadman

  • Full Member
  • ***
  • Posts: 185
  • Derp
Re: How to rotate cube to 'tip' it?
« Reply #1 on: April 11, 2014, 08:20:23 PM »
Parent the cube to an empty game object (as you've done). Move the empty gameobject's locator gizmo (the 3 axis arrow thingy) to wherever you want the pivot point of the cube to be (its edge).

Rotate/itween/etc the parent object, and not the cube itself :D