Search Unity

Changing a gizmo's position

Discussion in 'World Building' started by jsull1, Apr 26, 2018.

  1. jsull1

    jsull1

    Joined:
    Apr 3, 2018
    Posts:
    121
    I've made a character and added script, animation and physics but its gizmo doesn't line up in the center of it and so he's not working correctly. Is there anyway to move the gizmo independently?
     
  2. jsull1

    jsull1

    Joined:
    Apr 3, 2018
    Posts:
    121
    I discovered the problem is that the transparent background I have is still considered part of the object. How can I fix this?? Screen Shot 2018-04-25 at 9.05.04 PM.png
     
  3. Sluggy

    Sluggy

    Joined:
    Nov 27, 2012
    Posts:
    989
    The Gizmos utility class has a static Matrix field you can use to change the scaling, rotation, and translation of all rendered gizmos.
     
  4. chatrat12

    chatrat12

    Joined:
    Jan 21, 2015
    Posts:
    122
    I assume you are using a Sprite object in this scenario. All you need to do is simply move the pivot point of your Sprite. Go to your sprite in the Project panel and and click the 'Sprite Editor' button in the inspector. From there you can adjust the pivot and shrink the borders of your sprite to not contain the transparent parts.

    SpriteEditorButton.PNG

    Docs to the Sprite Editor
     
    Kurt-Dekker likes this.