Erro cs0201 unity 5

Galera estou fazendo um projeto para faculdade simples, mas é minha primeira vez que utilizo Unity 5, então na hora do script dá erro no renderer.material; abaixo meu código.

using UnityEngine;
using System.Collections;

public class Moveset : MonoBehaviour {

private Material currentMaterial;
public float speed;
private float offset;

// Use this for initialization
void Start () {
currentMaterial = renderer.material;

}

// Update is called once per frame
void Update () {
offset += 0.001f;
currentMaterial.SetTextureOffset (“_MainTex”, new Vector2 (offset * speed, 0));
}
}

I didn’t bother translating that, but did you try GetComponent() instead of renderer?

1 Like

thanks this correct.