docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method GetMousePosition

    GetMousePosition(float, bool)

    Get the mouse position in the scene or game view.

    Declaration
    public Vector2 GetMousePosition(float ScreenHeight, bool sceneView)
    Parameters
    Type Name Description
    float ScreenHeight

    Window height.

    bool sceneView

    Get position in the scene view?

    Returns
    Type Description
    Vector2

    Coordinates of the mouse in the specified window.

    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)