Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Cursor API - actual pointer is far away from image

Discussion in 'Editor & General Support' started by EKO_LX, Apr 19, 2021.

  1. EKO_LX

    EKO_LX

    Joined:
    Dec 25, 2020
    Posts:
    45
    Hey guys,
    I'm trying to use the Cursor API on my 3D game. I have an issue that actual pointer is above the image.
    From screenshot the red point is a mouse pointer and blue is where I would like to pointer to be.
    Screen Shot 2021-04-19 at 22.23.55.png
    In internet saying that "Texture Type" should be "Cursor" but actually it works same way as with "Sprite 2D".
     
  2. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,722
  3. EKO_LX

    EKO_LX

    Joined:
    Dec 25, 2020
    Posts:
    45
  4. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,722
    What did you set the hotspot to
     
  5. EKO_LX

    EKO_LX

    Joined:
    Dec 25, 2020
    Posts:
    45
    By default I set hotspot to Vector2.zero, so I assume it means target point should be at the top left of image. But result was as shown above.
    After some experiment I set the sprite max size to 256, and hotspot X:110, Y:60, now it works fine.
    Thanks.