Ok, it was easier than I thought; Now if you mess around with a switch at a higher rate the effect is, well, as desired :) if (hit.collider.tag == "LightBulb") {
if ((Time.time - lastTapTime) < tapSpeed)
{
Debug.Log("Destroyed!");
LIGHTON.SetActiveRecursively (false);
LIGHTOFF.SetActiveRecursively (true);
LightSwitchControler.active = false;
LightSwitchControlerDummy.active = true;
GameObject.Find("MainCamera").SendMessage("LightRoom");
}
lastTapTime = Time.time; }
↧