Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Help

Discussion in 'Scripting' started by lateorca, Jan 30, 2021.

  1. lateorca

    lateorca

    Joined:
    Aug 19, 2020
    Posts:
    2
    CS0117 error what am I doing wrong?

    Code (CSharp):
    1. using UnityEditor;
    2. using UnityEngine;
    3.  
    4. public static class AudioUtilProxy
    5. {
    6.     public static void PlayClip(AudioClip audioClip)
    7.     {
    8.         AudioUtil.PlayClip(audioClip);
    9.     }
    10. }
    11.  
     
    hmeliq likes this.
  2. Suddoha

    Suddoha

    Joined:
    Nov 9, 2013
    Posts:
    2,824
    What about posting the entire error message? Noone remembers the error codes and even if you google them, you know what it's all about but there is information that only you can provide...

    In this specific case, it seems to be about trying to access a member that doesn't exist.

    The only member that's accessed in the snippet you've attached is AudioUtil's static PlayClip method... does it exist?
     
  3. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,780
    Terraya and mopthrow like this.
  4. lateorca

    lateorca

    Joined:
    Aug 19, 2020
    Posts:
    2
    Does this help at all?

    Library\PackageCache\com.unity.learn.iet-framework@0.3.0-preview.5\Framework\Interactive Tutorials\Editor\Internal Proxy\AudioUtilProxy.cs(8,19): error CS0117: 'AudioUtil' does not contain a definition for 'PlayClip'
     
  5. Hikiko66

    Hikiko66

    Joined:
    May 5, 2013
    Posts:
    1,302
    AudioUtil does not have an accessible function called PlayClip

    So, type "AudioUtil."
    The dot should bring up the function list in your code editor for AudioUtil. Find what the function is really called. The function name might have changed between versions. Uppercase and Lowercase also have to match. So if it was really Called "Playclip" and you typed "PlayClip", for example, then you would still get this error

    Looks like the function names have changed?
    https://github.com/Unity-Technologi...Mono/Audio/Bindings/AudioUtil.bindings.cs#L30

    PlayPreviewClip
     
    Last edited: Feb 7, 2021
    Suddoha likes this.
  6. wechat_os_Qy07VqZ6L7cZBZ5wrKDX6V-hE

    wechat_os_Qy07VqZ6L7cZBZ5wrKDX6V-hE

    Joined:
    Jan 15, 2021
    Posts:
    1
    I have some problem, did you solve it?
     
    hmeliq likes this.
  7. OmerNazir

    OmerNazir

    Joined:
    Dec 3, 2020
    Posts:
    2
    I solved this issue by just upgrading the package