Question by
MMCOPY · Feb 27 at 12:21 PM ·
audiosourcepitch
I can't set AudioSource pitch. It said "Value cannot be null"
here's the script.
void Start()
{
this.gameObject.GetComponent<AudioSource>().pitch = 1.4f;
}
and I got this error after I play it.
ArgumentNullException: Value cannot be null.
Parameter name: source
edit: I tried change the pitch from another script and then it works. But still want to know why can't i change the pitch from this script.
Comment
Your answer
Follow this Question
Related Questions
Controlling Pitch of Audio Source with the objects Position (Y position) 2 Answers
How to change the speed of an audio without affecting its pitch and vice a versa at runtime? 2 Answers
car audio pitch help? 1 Answer
AudioListener changes only volume and not pitch 1 Answer
AudioSource.PlayOneShot with negative pitch won't start new sounds 0 Answers