Unity3D Scroll Background !
THIS IS C# script: GOOD 4 2D GAMES AND 3D GAMES !
--------------------------------------------------------------------------------------
DIRECT DOWNLOAD HERE
THIS IS BACKUP IN TEXT FORM TUTORIAL 23/24
1. Create New C# and name it : ScrollBackground
2. Copy & Past this text and save C# :
---------------------------------------------------------------------------------
using UnityEngine;
using System.Collections;
public class ScrollBackground : MonoBehaviour
{
public float scrollSpeed = 0.05F; // speed
void Update()
{
//smooth
float offset = Time.time * scrollSpeed;
//texture offset
renderer.material.mainTextureOffset = new Vector2(offset, 0);
}
}
---------------------------------------------------------------------------------
0 comments:
Post a Comment