Hello, I’m new to programming in C #, and I was trying to create a Flappy Bird type game, just to get used to a bit with C #, but whenever I do a script to make my scenario move gives some annoying error , That whenever I fix something happens in another error, I would be very happy if anyone could help me, sorry for my bad English, I am using google translator =)
My script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MoveOffset : 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));
}
}