Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Feedback The 'pivot' argument to the 'Sprite.Create()' method and the 'Sprite.pivot' variable are confusing.

Discussion in '2D' started by h765643729, Apr 20, 2023.

  1. h765643729

    h765643729

    Joined:
    Jan 17, 2018
    Posts:
    21
    They are both named 'pivot' and their data type is Vector2.
    But the 'pivot' argument of 'Sprite.Create()' is scaled, and the 'Sprite.pivot' variable is in pixels.
     
    DragonCoder likes this.
  2. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    1,503
    I also remember being annoyed at this last time I touched Sprite.Create. Perhaps Sprite.Create should name its parameter relativePivot?
     
  3. karderos

    karderos

    Joined:
    Mar 28, 2023
    Posts:
    376
    sprite.create is consistent with the texture import settings though. prob sprite.pivot that should be changed