Roll/rotate a cuboid at its edge
Hello there
I have a cuboid (a cube width 1 unit width and 2 units height), and I want to roll it/rotate it around a pivot point at its edge.
When I click the left arrow button, the cuboid should rotate around the bottom left edge and when I press up arrow, it should rotate on the bottom edge longest away from the camera. The behavior should be like in this game - https://www.youtube.com/watch?v=eaBTCCZNjSY
I have an image which may illustrate what I mean
My problem is how I can rotate around the cuboids edge, and then reset the pivot point to the center of the cuboid afterwards. Please help me, since I can't figure out how to solve this problem at the moment.
Answer by Ambrose998800 · Dec 12, 2015 at 11:59 AM
Work with different empties (5; one at each edge, one in the middle) you can use as pivot point/axis point.
Answer by Bunny83 · Dec 12, 2015 at 12:34 PM
Duplicate question:
http://answers.unity3d.com/questions/144830/how-to-rotate-around-object-axis.html#answer-144865
I don't have a cube of 1x1 units, but a cuboid at 1x2 units (a rectangle)... How can I find out if I need to use half a unit length or a whole unit length, when rotating? some of the side are a little longer away from the cuboid center, than others.
Follow this Question
Related Questions
Roll cuboid does not work properly 1 Answer
So I want to rotate this cube... 1 Answer
Cube rolling problem (rotation problem) 1 Answer
Turret following target 0 Answers
Mapping a cube to sphere 0 Answers