Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

Got this error: "ArgumentNullException: Value cannot be null." and I don't understand why

$
0
0
I have this script for every time I click the left mouse button a sound is played. Everything works fine but I keep seeing an error pop up every time I click. The error states "ArgumentNullException: Value cannot be null" and I don't know why this error keeps popping up Here's the code I'm using: public class AudioPlay : MonoBehaviour { // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { if (Input.GetMouseButtonDown(0)) //Detects if Left Mouse Button is clicked { GetComponent().Play(); } } }

Viewing all articles
Browse latest Browse all 2891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>