Hi
I’m trying to create a program that will let me make the ground scroll for a while (c#) but my program movement doesn’t have a return type and im not sure what to use.
I’ve done this so far…
using UnityEngine;
using System.Collections;
public class GroundMovement : MonoBehaviour {
public bool characterSelected;
private int groundCountdown;
public bool groundOneFinnished;
// Use this for initialization
void Start () {
characterSelected = false;
groundCountdown = 60;
groundOneFinnished = false;
if (characterSelected == true) {
Movement();
}
}
public Movement ()
{
transform.position = new Vector3(-1.385, 0.0f, 0.0f);
yield return new WaitForSeconds(0.1);
transform.position = new Vector3(-1.385, 0.0f, 0.0f);
yield return new WaitForSeconds(0.1);
transform.position = new Vector3(-1.385, 0.0f, 0.0f);
yield return new WaitForSeconds(0.1);
transform.position = new Vector3(-1.385, 0.0f, 0.0f);
yield return new WaitForSeconds(0.1);
transform.position = new Vector3(-1.385, 0.0f, 0.0f);
yield return new WaitForSeconds(0.1);
transform.position = new Vector3(-1.385, 0.0f, 0.0f);
yield return new WaitForSeconds(0.1);
transform.position = new Vector3(-1.385, 0.0f, 0.0f);
yield return new WaitForSeconds(0.1);
transform.position = new Vector3(-1.385, 0.0f, 0.0f);
yield return new WaitForSeconds(0.1);
transform.position = new Vector3(-1.385, 0.0f, 0.0f);
yield return new WaitForSeconds(0.1);
transform.position = new Vector3(-1.385, 0.0f, 0.0f);
yield return new WaitForSeconds(0.1);
groundCountdown = groundCountdown - 1;
if (groundCountdown == 0) {
groundOneFinnished = true;
}
else
{
Movement();
}
}
}
What should i put as the return type for Movement?
Thanks