I don't know what's going on. I followed the tutorial exactly and it's still giving me an error.
No other guides on this website have helped me and I don't know what I'm doing wrong
using System.Collections.Generic;
using UnityEngine;
public class ScreenShakeController : MonoBehaviour
{
private float shakeTimeRemaining, shakePower;
public static void Miss()
{
StartShake(0.25f, 1f);
}
private void LateUpdate()
{
if(shakeTimeRemaining > 0)
{
shakeTimeRemaining -= Time.deltaTime;
float xAmount = Random.Range(-1f, 1f) * shakePower;
float yAmount = Random.Range(-1f, 1f) * shakePower;
transform.position += new Vector3(xAmount, yAmount, 0f);
}
}
public void StartShake(float length, float power)
{
shakeTimeRemaining = length;
shakePower = power;
}
}