Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Runtime Transform Gizmos (Move, Rotate, Scale, Universal, Scene Gizmo, Navigation Camera)

Discussion in 'Assets and Asset Store' started by XGT08, Sep 13, 2018.

  1. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,423
    Hi everyone,

    This is the official support forum for Runtime Transform Gizmos. This is a scripting API which allows you to use transform gizmos at runtime (i.e. build, in-game). Super handy if you need to build editor applications, modding tools or simply games that allow the player to move/rotate/scale objects in the scene.

    Here is a quick overview of the pack:


    The entire list of video tutorials can be found here.

    Don't forget to check out the API Docs.

    If you need collider and light gizmos, then you might also want to take a look at this plugin: Runtime Collider & Light Gizmos.

    Enjoy!
     
    Last edited: Feb 12, 2020
    Mark_01 likes this.
  2. Artur2024

    Artur2024

    Joined:
    Aug 29, 2016
    Posts:
    2
    Can you use moving, rotating and scaling with collision control?
     
  3. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,423
    Hi there,

    Collision control is not implemented and to be honest with you, I have no idea what that means in this context. Can you please detail?

    Thanks,
    Andrew
     
  4. dornseif

    dornseif

    Joined:
    Aug 25, 2016
    Posts:
    7
    Any plans to make this work for GameObject Transforms? Your tutorials all focus on shapes and simple objects but I would like to use this for posing characters in VR.
     
  5. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,423
    I'm afraid I don't understand :) The gizmos already work with GameObject transforms. That is the main purpose of the pack. You can if you want take it a bit further and use the gizmos to transform any entities that you wish by listening to drag events but Game Object transform is supported out of the box.

    VR is more of an input problem and there are currently no plans for VR.

    EDIT: To be clear: you can pose characters using the pack, but not in VR because VR is not supported.
     
  6. EdwinHolanda

    EdwinHolanda

    Joined:
    Dec 15, 2017
    Posts:
    1
    Hello, i'm creating a custom editor for my app and I have your plugin, it works fine.

    What I want to do is use your gizmos through a virtual camera, using a render texture from UI canvas.

    I want to have tabs for scenes and I'm not able to record events for your gizmos. I already have a setup using a custom raycast to my render texture and it works fine, i can interact with my scene using the virtual camera, but not with your gizmos.

    How can i achieve that?

    I changed the Method from your class MouseInputDevice to use my custom raycast, also not working

    Code (CSharp):
    1. public override Ray GetRay(Camera camera = null)
    2.     {
    3.         return CameraManager.instance.VirtualRaycast();
    4.     }
    my code for raycasting at the render texture is the following:

    Code (CSharp):
    1. public Vector2 VirtualCameraPoint()
    2.     {
    3.         Vector2 localpoint;
    4.  
    5.         RectTransformUtility.ScreenPointToLocalPointInRectangle(
    6.             virtualCamera, //rect transform of the UI rendertexture
    7.             Input.mousePosition,
    8.             null,
    9.             out localpoint
    10.         );
    11.  
    12.         return localpoint;
    13.     }
    14.  
    15.     //raycast through scene camera using render texture
    16.     public Ray VirtualRaycast()
    17.     {
    18.         //scene camera is a camera with render texture of the active scene
    19.         return sceneCamera.ScreenPointToRay(VirtualCameraPoint());
    20.     }
    Also, I already have cameras, inputs, grid and etc made by me. Is that a way to not use your plugin without needing to use your RTGApp, only the Runtime Gizmos (scene, move, rotation, scale)?
     
  7. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,423
    Hi there,

    Rendering to a UI texture on a canvas is not possible. I have received this inquiry once before but I have not been able to make it work. If you need a custom viewport, you can adjust the viewport of the camera accordingly. Just make sure to use the latest version of the pack because it fixes a bug with custom viewports.

    You can use your own camera, but input and grid needs to stay there.
    In order to use a custom camera, you have to:
    1. select the RTFocusCamera object in the hierarchy view;
    2. in the Inspector, uncheck the Can process input;
    3. drag and drop your camera object in the Target camera field.
     
  8. Saki_col

    Saki_col

    Joined:
    Feb 3, 2018
    Posts:
    6
    Hello, is it posible to hide/lock some of the axis in the rotation Gizmo? (I dont want the user to rotate the X or Z axis)
     
  9. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,423
    Hi there,
    Yes it is possible, using the following code:
    rotationGizmo.LookAndFeel3D.SetAxisVisible(0, false); // 0 - X axis
    rotationGizmo.LookAndFeel3D.SetAxisVisible(2, false); // 2 - Z axis
     
  10. Saki_col

    Saki_col

    Joined:
    Feb 3, 2018
    Posts:
    6
    Hi, im testing your Demo, but if feels a little slow when I move the objects... I'm a little worried about the performance of the proyect if I implement this asset.
     
  11. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,423
    I find it hard to believe that the demo is slow :) What are your system specs?
     
  12. Saki_col

    Saki_col

    Joined:
    Feb 3, 2018
    Posts:
    6
    ------------------
    System Information
    ------------------
    Operating System: Windows 10 Pro 64-bit (10.0, Build 17134) (17134.rs4_release.180410-1804)
    Language: Spanish (Regional Setting: Spanish)
    System Manufacturer:
    System Model:
    BIOS: BIOS Date: 05/31/12 17:10:26 Ver: 04.06.04 (type: BIOS)
    Processor: no disponible
    Memory: 8192MB RAM
    Available OS Memory: 8162MB RAM
    Page File: 12145MB used, 2161MB available
    Windows Dir: C:\WINDOWS
    DirectX Version: DirectX 12
    DX Setup Parameters: Not found
    User DPI Setting: 96 DPI (100 percent)
    System DPI Setting: 96 DPI (100 percent)
    DWM DPI Scaling: Disabled
    Miracast: Not Available
    Microsoft Graphics Hybrid: Not Supported
    DxDiag Version: 10.00.17134.0001 64bit Unicode


    ---------------
    Display Devices
    ---------------
    Card name: AMD Radeon HD 6450
    Manufacturer: Advanced Micro Devices, Inc.
    Chip type: AMD Radeon Graphics Processor (0x6779)
    DAC type: Internal DAC(400MHz)
     
  13. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,423
    Well, I don't know how it could be slow. There is no reason why it should be slow, especially since it's a really simple scene. I'm afraid I can not help here. It works really well for me and for other customers.
     
  14. Saki_col

    Saki_col

    Joined:
    Feb 3, 2018
    Posts:
    6
    The slow thig is like an input delay or something like that.
    It have some delay between the mouse move and the object following the mouse (in the translate tool)
     
  15. Saki_col

    Saki_col

    Joined:
    Feb 3, 2018
    Posts:
    6
    Ok... I was just afraid about the performance, if another customers don't have any problem ill buy it
     
  16. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,423
    Well, if it's slow for you, then I am not willing to take any responsibility. It's better if you search for another pack with a demo that works well for your system :)
     
  17. nandonandito

    nandonandito

    Joined:
    Nov 24, 2016
    Posts:
    39
    hi, i would like to use this asset for my mobile apps project.. is this support if i build for mobile? thankyou
     
  18. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,423
    Hi there,

    Mobile is supported only for gizmo interaction. As for the other features, such as camera, object to object snap, surface snap, those do not work on mobile.
     
  19. nandonandito

    nandonandito

    Joined:
    Nov 24, 2016
    Posts:
    39
    ah nice, yes the important is gizmo interaction for my case. so its mean if i need to have my own script to do "such as camera, object to object snap, surface snap," right?
     
  20. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,423
    Yes, so gizmo interaction can be done on mobile, but the other would require that you either change the scripts to adapt them for mobile or implement them from scratch. I think the source code can be changed and adapted for mobile, but in my personal opinion this kind of app is not suitable for mobile. I have no plans to adapt all the scripts for mobile :)
     
  21. nandonandito

    nandonandito

    Joined:
    Nov 24, 2016
    Posts:
    39
    that was great.. i really like this assets. thankyou
     
  22. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,423
    No problem :)
     
  23. Mooshoo-Labs

    Mooshoo-Labs

    Joined:
    Aug 21, 2014
    Posts:
    19
    Hi, I'm trying to use your gizmos on mobile. I'm trying to remove all the modules apart from the ones required to create gizmos. Can you point me in the right direction?

    Thanks
     
  24. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,423
    You can disable the camera, scene grid and Undo/Redo modules, but you have to still keep the objects in the hierarchy. Don't delete them.

    So for the camera, select the RTFocusCamera object in the hierarchy view and then uncheck the Can process input toggle like in the image below:
    RTFocusCamera.png

    For the scene grid, you need to select the RTSceneGrid object in the hierarchy and uncheck the Is visible toggle.

    For the Undo/Redo system, you will need to do this from script at app startup:
    Code (CSharp):
    1. RTUndoRedo.Get.SetEnabled(false);
     
    Mooshoo-Labs likes this.
  25. crimn

    crimn

    Joined:
    Jan 8, 2013
    Posts:
    24
  26. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,423
  27. JonNotJohn

    JonNotJohn

    Joined:
    Feb 28, 2018
    Posts:
    2
    Hello!

    I found a bug with the movement gizmo where the OnGizmoPostDragBegin event is sending the wrong GizmoHandleId for the Y and Z caps. I just wanted to let you know. I'm not sure if someone else has already mentioned this or not.
     
  28. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,423
    Hi there,

    Thanks for bringing this to my attention. I will fix this and let you know when it's ready.

    Cheers,
    Andrew
     
    JonNotJohn likes this.
  29. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,423
    Hi there,

    The issue was fixed. I've sent you a PM with a link to the updated pack.

    Cheers,
    Andrew
     
    JonNotJohn likes this.
  30. JonNotJohn

    JonNotJohn

    Joined:
    Feb 28, 2018
    Posts:
    2
    Thanks for the quick response! Keep up the good work!
     
  31. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    482
    Is it possible to disable the scene gizmo? I can't see any way aside from commenting out the call to CreateSceneGizmo in RTGApp.Start.

    Thanks,
    Sam
     
  32. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,423
    Hi there,

    You can accomplish this by writing:
    Code (CSharp):
    1. RTGizmosEngine.Get.GetSceneGizmoByCamera(RTFocusCamera.Get.TargetCamera).OwnerGizmo.SetEnabled(false);
    You should write this in the Initialized event which is thrown by the RTGApp objects after it has been initialized.

    So somewhere in one of your script's Awake functions, you should write:
    Code (CSharp):
    1. RTGApp.Get.Initialize += OnAppInitialized;
    The OnAppInitialized handler will have to contain the code that disables the gizmo.

    Cheers,
    Andrew
     
    samizzo likes this.
  33. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    482
    Thanks!
     
  34. crimn

    crimn

    Joined:
    Jan 8, 2013
    Posts:
    24
    I am having some problem with the "box scale gizmo", when you drag it to scale 0, it become glitchy, it's start move the entire object, also i am having other problems when my objects become with scale 0 or negative value ,so my question is, is there any way to modify some script and to disallow the "box scale gizmo" from going under 0.2f scale for example, i am creating an map editor like this one https://krunker.io/editor.html it's basically simple editor and grid based, but i cannot find the right script that control the scale drag for that "box scale gizmo", can you point me up with some information that can help me with this? (sorry for my bad english)
     
  35. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,423
    Hi there,

    Thanks for reporting this. I will take a look at it and let you know when the issue has been fixed.

    Cheers,
    Andrew
     
  36. crimn

    crimn

    Joined:
    Jan 8, 2013
    Posts:
    24
    Great thank you.
    also it will be great if we can use the "box scale gizmo" when we have multiple selected objects like the rest of the gizmos.
     
  37. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,423
  38. Qbasic8

    Qbasic8

    Joined:
    May 22, 2014
    Posts:
    16
    I'm trying to have a small 'preview window' that a player can use the gizmo to rotate a gameobject on a Canvas via RenderTexture. Is there a way to implement this easily with this?
     
  39. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,423
    Hi there,

    Unfortunately, that is not possible. If you wish to render the gizmos to an area of the screen, you will have to use viewports instead. You can find more about viewports here: https://rtg.readthedocs.io/en/latest/ViewportAPI/

    Rendering gizmos to a render texture creates problems when interacting with the gizmos and this is something I could not solve.
     
  40. SentryGames

    SentryGames

    Joined:
    Jun 4, 2014
    Posts:
    16
    Hi Octamodius,

    I wonder if your package works with HDRP ?
    It seems to be really powerfull but our project is on HDRP and we need a runtime gizmo tool working on it ...

    Thx :)
    Again, good job !

    NarLoke
     
  41. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,423
    Hi there,

    Unfortunately RTG does not work with SRP and there are currently no plans to support it. I wish I had a different answer :)

    All the Best,
    Andrew
     
    SentryGames likes this.
  42. jexmatex

    jexmatex

    Joined:
    Jun 23, 2016
    Posts:
    47
    Hi there,,

    i'm having trouble to have by default the Local transform on for unknow reason it is always in global mode
    any line of code to change somewhere ?

    thanks by advance
     
  43. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,423
    Hello,

    All gizmos have a ObjectTransformGizmo property and you would need to write something like this:
    Code (CSharp):
    1. gizmo.ObjectTransformGizmo.SetTransformSpace(GizmoSpace.Local);
    You might want to check out this video in which I cover transform spaces:


    Cheers,
    Andrew
     
  44. jexmatex

    jexmatex

    Joined:
    Jun 23, 2016
    Posts:
    47
    Tank you very much Andrew for your fast reply

    going to take a look at it !

    cheers
     
  45. TonismoGames

    TonismoGames

    Joined:
    Jun 12, 2018
    Posts:
    42
    Hi,I have just bought the asset. It is very useful. I am having and issue during runtime when i start up. upload_2019-7-4_18-32-44.png
     
  46. TonismoGames

    TonismoGames

    Joined:
    Jun 12, 2018
    Posts:
    42
    I had an issue with using the mouse to move the gizmos. Changing these lines of codes fixed it.
    upload_2019-7-4_22-34-21.png
     
  47. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,423
    GetAxis should work just fine. Maybe you changed the name of the mouse X axis in the input settings.

    Regarding the other issues, I will look into it.
     
  48. bearforceone

    bearforceone

    Joined:
    Apr 12, 2018
    Posts:
    1
    Hello,

    Is there any way to remove/disable a specific Universal Gizmo targeting a Game Object?
     
  49. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,423
    Hi there,

    All gizmos have a SetEnabled function which you can use to enable/disable the gizmo as needed.
     
  50. gamebytom

    gamebytom

    Joined:
    Mar 13, 2017
    Posts:
    10
    I have an issue - I'm using the gizmos for multiple objects, but only one object has the gizmos active at a time. Each object has a translation rotation and scaling gizmo (with only one visible). I'm using SetEnabled() to switch off all the gizmos on all objects except for the selected object. Unfortunately, when the objects are close together (and only at certain camera angles), it becomes impossible to manipulate the active gizmo. The problem disappears if I don't use the SetEnabled() function to switch off the gizmos. I would appreciate any advice on this.
     
unityunity