Skip to content

Instantly share code, notes, and snippets.

@Narven
Created May 7, 2014 07:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Narven/cdff1f2d556c51e51d40 to your computer and use it in GitHub Desktop.
Save Narven/cdff1f2d556c51e51d40 to your computer and use it in GitHub Desktop.
Unity3d javascript scrolling texture
var scrollSpeed = 0.90;
var scrollSpeed2 = 0.90;
function FixedUpdate()
{
var offset = Time.time * scrollSpeed;
var offset2 = Time.time * scrollSpeed2;
renderer.material.mainTextureOffset = Vector2 (offset2,-offset);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment