So when I went through this particular lecture, He said to make the object run away from the camera and back again.
Of course that made me make something in the script that would do this (although I did think maybe he just means changing the value via inspecter)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Mover : MonoBehaviour
{
[SerializeField] float xValue = 0.0f;
[SerializeField] float yValue = 0.01f;
[SerializeField] float zValue = 0.0f;
[SerializeField] int steps = 0;
[SerializeField] int maxSteps = 60;
bool runAway = false;
// Start is called before the first frame update
void Start()
{
transform.Translate(1,0,0);
}
// Update is called once per frame
void Update()
{
if (steps == maxSteps)
runAway = false;
else if(steps == 0)
runAway = true;
if(runAway)
{
transform.Translate(xValue, yValue, zValue);
steps++;
}
else
{
transform.Translate(-xValue, -yValue, -zValue);
steps--;
}
}
}
Of course after unpausing I realised he was going to do what I though but any way…
The humour is there xD
Also I know the code is aweful but it was just a quickie at the time