Search Unity

control texture offset by camera y rotation?

Discussion in 'Scripting' started by Cheeeese, Nov 28, 2012.

  1. Cheeeese

    Cheeeese

    Joined:
    Oct 5, 2012
    Posts:
    12
    View attachment 41269

    I'm working on a compass dial that moves with camera y rotation but need help getting my math right.
    I'm using a textured plane to show the reading. The texture is 1024 pixel wide, and the tiling on the plane 0.1

    I got the numbers to move with the camera, but they skip right before getting back to 0 because I'm missing something.

    This is what I have but I'm missing the tiling in the equation. The numbers scroll too fast.

    Thanks for your help.

    UPDATE: I found an asset that does that (ProCOMPASS: Compass, Minimap & Navigator)
    https://assetstore.unity.com/packages/tools/gui/procompass-compass-minimap-navigator-194702
     
    Last edited: Nov 8, 2023