Hello everybody, i am trying to make moving background meanwhile changing color like in the game
Magnets but i have no idea how to make it. Any ideas ??
You need a UV scroller:
using UnityEngine;
using System.Collections;
public class UVScroll : MonoBehaviour
{
public float offsetX = 0.5F;
public float offsetY = 0.5F;
private Renderer rend;
void Start()
{
rend = GetComponent<Renderer>();
}
void Update()
{
float offsetx = Time.time * offsetX;
float offsety = Time.time * offsetY;
rend.material.mainTextureOffset = new Vector2(offsetx, offsety);
}
}
Let me know if this helps
Not totally sure what you’re asking for, but shaders are probably what you’re after. Using shaders you can scroll texture UV, change colouring etc.
They can be a bit confusing for beginners but if you want to make pretty games, they are essential.