Search Unity

Runtime Scene Gizmo for uGUI [Open Source]

Discussion in 'Assets and Asset Store' started by yasirkula, Jul 11, 2018.

  1. yasirkula

    yasirkula

    Joined:
    Aug 1, 2011
    Posts:
    2,879
    Last edited: May 31, 2023
    TigerHix and airnamics like this.
  2. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    789
    Nice! I can definitely use that :)
    Any plans for move and rotate gizmos as well? Maybe even the cool unreal ones? :D
     
  3. yasirkula

    yasirkula

    Joined:
    Aug 1, 2011
    Posts:
    2,879
    Unreal gizmos surely look very cool :D However, I don't have any plans for Transform gizmos yet; I must finish a couple of other projects first. There are some open source Transform gizmo solutions out there already, I'd recommend you to check them out if you haven't already done so (just google "unity runtime gizmos github").
     
    dadude123 likes this.
  4. yasirkula

    yasirkula

    Joined:
    Aug 1, 2011
    Posts:
    2,879
    Now live on Asset Store!
     
  5. Thibault_potier

    Thibault_potier

    Joined:
    May 4, 2021
    Posts:
    46
    Hi !

    First of all, I love this asset. easy to use and efficient, lovable.

    That being said, I'm trying to modify it a little to fit my needs: I'm looking for a way to have this gizmo Z up instead of Y up.

    " Gizmo's rotation will match the main camera's rotation but it is possible to change the reference object via GizmoRenderer's Reference Transform property. "

    -> I tried that, but then the gizmo doesn't update anymore when I move my camera. (moving my camera doesn't affect the gizmo anymore)

    So I also tried to change the gizmo prefab rotation by adding a new gameObject to make the desired rotation:
    upload_2021-10-25_13-17-27.png

    But then when I click on the Gizmo axis it set the camera facing the wrong axis

    Is there any simple way I'm missing to use this gizmo Z up ?
     
  6. yasirkula

    yasirkula

    Joined:
    Aug 1, 2011
    Posts:
    2,879
    In the first method, you have to also update the Reference Transform's rotation as you rotate the camera (otherwise moving the camera will have no effect as you've seen). In the second method, you can set Y+'s Mesh Filter mesh to BlueGizmoCone and its label to z, then modify Z+ to have GreenGizmoCone and label y.
     
    Thibault_potier likes this.
  7. ludm80

    ludm80

    Joined:
    Mar 10, 2020
    Posts:
    6
    Hello,
    Thank you for this helpful asset, it's great.
    I have just a problem:
    When I export DemoScene and the scene with hierarchy to webgl, in both scenes the gizmo is pixelated.
    Do you know how can I solve this?
    I use Unity 2019.4
     
  8. yasirkula

    yasirkula

    Joined:
    Aug 1, 2011
    Posts:
    2,879
    When playing a WebGL game on itch.io, if I don't enter full-screen mode, the game is rendered somewhat blurry. I wonder if this is also a similar issue. If everything else renders perfectly fine, then the gizmo's resolution might be calculated too small. You can try setting a resolution manually (like
    int gizmoResolution = 512;
    ) at this line.
     
  9. dyxwxjdy

    dyxwxjdy

    Joined:
    Mar 30, 2020
    Posts:
    15
    Hello, cannot click gizmo after change Canvas Mode to Sceen-Space Camera. Is it possible to change the canvas mode?
     
  10. yasirkula

    yasirkula

    Joined:
    Aug 1, 2011
    Posts:
    2,879
    @dyxwxjdy You're right. Changing SceneGizmoRenderer's 101th line as follows resolves the issue:
    RectTransformUtility.ScreenPointToLocalPointInRectangle( imageHolderTR, eventData.position, eventData.enterEventCamera, out localPos );
     
  11. dyxwxjdy

    dyxwxjdy

    Joined:
    Mar 30, 2020
    Posts:
    15
    That solves problem, thank you!