Quantcast
Channel: Questions in topic: "static variables"
Viewing all articles
Browse latest Browse all 84

Sound Clip isn't playing when triggered.

$
0
0
I want my kill streak sound to be triggered when the KSsound value reaches 250. However the sound doesn't play when the value reaches 250. using System.Collections; using System.Collections.Generic; using UnityEngine; public class KSsoundScript : MonoBehaviour { public static int KSsound; AudioSource clip; void Awake () { clip = GetComponent (); } void Update () { if (KSsound >= 250) { clip.Play (); } } }

Viewing all articles
Browse latest Browse all 84

Trending Articles