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. Unity 2022.2 is now available as the latest Tech release.
    Dismiss Notice
  3. We are making some changes to the DOTS forums.
    Dismiss Notice
  4. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

error CS1061, CS1501, CS0120

Discussion in 'VR' started by psycolin, Mar 31, 2016.

  1. psycolin

    psycolin

    Joined:
    Mar 1, 2016
    Posts:
    4
    Hi,
    I am trying to follow along the tutorials here,
    https://developer.microsoft.com/en-...deo_learnmore_yt_USA_holomark_Organic_0229_11

    I have installed the required unity files, and the visual studio files. Only thing i could not install was the hololens emulator because it stops during installation for some reason. I am trying to follow the tutorial anyway determined to follow along until the build step.

    I downloaded the asset files provided in the tutorial page, opened them up in Unity Version 5.4.0b10-HTP Personal and get the following 3 errors in the unity console,

    Assets/Holograms/Support/Spatial Mapping/SpatialMapping.cs(44,18): error CS1061: Type `UnityEngine.VR.WSA.SurfaceObserver' does not contain a definition for `OnSurfaceChanged' and no extension method `OnSurfaceChanged' of type `UnityEngine.VR.WSA.SurfaceObserver' could be found (are you missing a using directive or an assembly reference?)

    Assets/Holograms/Support/Spatial Mapping/SpatialMapping.cs(54,22): error CS1501: No overload for method `Update' takes `0' arguments

    Assets/Holograms/Support/Spatial Mapping/SpatialMapping.cs(116,33): error CS0120: An object reference is required to access non-static member `UnityEngine.VR.WSA.SurfaceObserver.RequestMeshAsync(UnityEngine.VR.WSA.SurfaceData, UnityEngine.VR.WSA.SurfaceObserver.SurfaceDataReadyDelegate)'

    Are these errors occuring due to the missing emulator installation? If not, then how can i resolve these issues?
     
  2. Unity_Wesley

    Unity_Wesley

    Unity Technologies

    Joined:
    Sep 17, 2015
    Posts:
    558
    Hello,

    These are errors in the script of that project, based on the errors you have in your script it looks like it is out of date with current API.

    For issues with the emulator I would recommended looking on Microsoft forums or contacting them for support.

    https://developer.microsoft.com/en-US/windows/holographic/using_the_hololens_emulator

    You can look up the API which contains examples in the editor.
    Click Help->Scripting reference UnityEngine.VR.WSA and look for Surface Observer in the Classes drop down

    Thank you,
    Wesley
     
  3. psycolin

    psycolin

    Joined:
    Mar 1, 2016
    Posts:
    4
    Thank you for the prompt response.
    I will try and re download the asset files to see if they have changed them to match the new api.
     
  4. psycolin

    psycolin

    Joined:
    Mar 1, 2016
    Posts:
    4
    Issue solved, the errors are not there anymore, anybody having similar issues should update their code from here https://github.com/Microsoft/HolographicAcademy/

    They updated the problem files just now, :v, i guess the instructors are listening to this thread.
     
    devilqube, goosetea and austindoupe like this.
  5. Unity_Wesley

    Unity_Wesley

    Unity Technologies

    Joined:
    Sep 17, 2015
    Posts:
    558
    That's good, glad to see that issue is resolved for you.
     
  6. devilqube

    devilqube

    Joined:
    May 6, 2014
    Posts:
    2
    hi,
    Reference the emulator install error, I found it errored when Hyper V was not installed (requires Windows Pro licence).