Im making a crash bandicoot game and im currently working on the spin mechanic and the spin works when the key is pressed but the renderer wont disable after the spin so it just keeps spinning! how do i get it to work? This is my script at the moment? Please help!
Script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SpinStopper : MonoBehaviour {
public double timer = 1;
public GameObject SpinCB;
public GameObject RealCB;
void Update()
{
timer += Time.deltaTime;
if(timer <= 0)
{
timer -= 0.5;
SpinCB.SetActive(false);
RealCB.SetActive(true);
}
}
}