docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method RoundToPixel

    RoundToPixel(Vector3)

    Round a arbitrary position to an integer pixel position. Works in world space.

    Declaration
    public Vector3 RoundToPixel(Vector3 position)
    Parameters
    Type Name Description
    Vector3 position

    The position you want to round.

    Returns
    Type Description
    Vector3

    The rounded pixel position. Depending on the values of upscaleRT and pixelSnapping, it could be a screen pixel position or an art pixel position.

    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)