Search Unity

ArcBall rotation system

Discussion in 'Scripting' started by fra3point, Oct 30, 2014.

  1. fra3point

    fra3point

    Joined:
    Aug 20, 2012
    Posts:
    269
    Hi everybody! I'm trying to reproduce a basic version of the ArcBall rotation system (the one you use in the Scene Window). I tried different ways but no one seems to be good.
    I'm currently using a script that I attached to 3 round objects. Every object can be rotated in one (constrained) axis by click&drag. Also, the objects have another attached script which modify their non-constrained axes basing on the other two objects. Basically, this is the Unity built-in rotation system.

    But there's a difference between my solution and Unity's one: I can only rotate my object on an only axis while the real system changes the rotation following the current angle of the object. It's very very hard to explain! I hope someone can help me! :)

    Here some screenshot...

    This is what I want to reproduce:



    And this is my problem: