Search Unity

uv scroll

Discussion in 'PSM' started by nobuchan, May 29, 2014.

  1. nobuchan

    nobuchan

    Joined:
    Mar 14, 2014
    Posts:
    1
    下記コードで、UVスクロールさせようとしたんですが、
    PSVitaの場合、スクロールしないのですが、
    VitaはUVスクロール出来ない?、それとも
    "_MainTex"を、違うものに変えれば、スクロール出来るようになるのでしょうか?
    以上、よろしくおねがいします。
    //---------------------------------------------------------------------
    var scrollSpeed : float = 0.1;

    function Update () {
    var offset : float = Time.time * scrollSpeed;
    renderer.material.SetTextureOffset ("_MainTex", Vector2(0,offset));
    }
    //---------------------------------------------------------------------
     
  2. mehulshukla

    mehulshukla

    SCEE Dev Support PSM

    Joined:
    Nov 6, 2013
    Posts:
    21
    Just to translate, the question is - Is UV scrolling possible within unity and this is the code that was tried but did not work.
     
  3. PeteD

    PeteD

    Joined:
    Jul 30, 2013
    Posts:
    71
    You seem to be missing a new there as in

    renderer.material.SetTextureOffset ("_MainTex", new Vector2(0,offset));
     
  4. coolpowers

    coolpowers

    Joined:
    Mar 23, 2010
    Posts:
    125
    Yes, it's definitely possible to scroll UV values this way, because I do it. However, it may not work with the fixed-function shader emulation.
     
    Last edited: Jun 14, 2014