'PlatformAgnosticInput' does not exist - Occlusion Tutorial

Include the following details (edit as applicable):

  • Issue category: Real-time Mapping-Depth
  • Device type & OS version: Android / iOS
  • Host machine & OS version: Windows
  • Issue Environment : Unity Remote / Unity Mock
  • Xcode version:
  • ARDK version: ardk-2.0.0
  • Unity version: 2021.3.4f1

Description of the issue:

Hi there,
I am currently trying out the Basic Occlusion Tutorial (Tutorial: Basic Occlusions — Niantic Lightship Augmented Reality Developer Kit release-2.0 documentation), but after adding and compiling the example script I get the following Error Message:

Assets\OcclusionsTutorial.cs(41,21): error CS0103: The name ‘PlatformAgnosticInput’ does not exist in the current context

referencing this Codesnippet:
void Update()
{
//if there is a touch call our function
if (PlatformAgnosticInput.touchCount <= 0) { return; }

    var touch = PlatformAgnosticInput.GetTouch(0);
    if (touch.phase == TouchPhase.Began)
    {
        TouchBegan(touch);
    }
}

I had the same error when I tried to write the script on my own, but the problem remained after copypasting the example script. I really havo no clue why that might happen.

Hopefully you can help me out!
Greetings

Hi Josef, welcome to the Lightship community!

It has come to our attention that the script in Step 9 - Adding a hit test function to move our character of Tutorial: Basic Occlusions requires an additional using statement as of ARDK 2.0.0, and we’ve informed the team.

To resolve the The name ‘PlatformAgnosticInput’ does not exist in the current context. error, you can include the following using statement at the top of your script:

using Niantic.ARDK.Utilities.Input.Legacy;

Thanks, the include solved the compiling issue in Unity. Sadly it still didnt work out, but I think thats because the occlusion script interferes with an old hit-tester script i use to place my objects.

Old Hit-Tester and Depth Manager work fine, so everything checks out!

Thanks for your help

Hi there.

I’m having a similar issue. When I add using Niantic.ARDK.Utilities.Input.Legacy , I get the error he type or namespace name ‘Legacy’ does not exist in the namespace ‘Niantic.ARDK.Utilities.Input’.

Turns out it was the Input.System. I didn’t chose to use Both on Player Settings, so the Legacy Input was being ignored.

This topic was automatically closed 2 hours after the last reply. New replies are no longer allowed.