- Home /
Question by
Tyson1211 · Mar 27, 2015 at 03:22 PM ·
scripting problem
Parallax not working C#
Every time I connect this script to my sprite Clouds, or even to a plane or quad they dont move... I have no errors, and i don't know whts wrong with the script. I know this is not a direct question but I was wondering if someone could help me solve this problem? Bottom error dosent relate
using UnityEngine;
using System.Collections;
public class Parallax : MonoBehaviour
{
public float Speed=0.4f;
void Update ()
{
GetComponent<Renderer>().material.mainTextureOffset = new Vector2(Time.time * Speed,0);
}
}
untitled.jpg
(180.4 kB)
untitled-2.jpg
(265.3 kB)
Comment
notthat lol not important... I need to get my clouds hich are sprites to move in rotation
You can use neither offset nor tiling on SpriteRenderer. Use $$anonymous$$eshRenderer with a quad ins$$anonymous$$d.