Search Unity

[Solved] Cannot access back touch panel: The name 'PSMInput' does not exist in the current context.

Discussion in 'PSM' started by spmonahan, Sep 19, 2014.

  1. spmonahan

    spmonahan

    Joined:
    Sep 13, 2014
    Posts:
    3
    I'm not about to get input from the back touch panel on the PSVita with Unity PSM v4.3.4f1.

    I'm using the sample code from the PSM-specific features page:

    Code (csharp):
    1.  
    2. using UnityEngine.PSM;
    3.  
    4. // ...
    5.  
    6. void OnGUI () {
    7.     foreach (Touch touch in PSMInput.touchesSecondary)
    8.     {
    9.         Vector2 pos = touch.position;
    10.         GUI.Label(new Rect(pos.x, Screen.height - pos.y, 50, 30), "(X) #" + touch.fingerId);
    11.     }
    12. }
    13.  
    The error I get is error CS0103: The name 'PSMInput' does not exist in the current context.

    I'm able to read input from the front touch screen (using the sample on the same page linked above), analog sticks, buttons, gyroscope, accelerometer and compass.

    Has anyone been able to get input from the rear touch panel? How?

    Thanks!
     
  2. eriQue

    eriQue

    Unity Technologies

    Joined:
    May 25, 2010
    Posts:
    595
    You are sure you're not missing the
    Code (CSharp):
    1. using UnityEngine.PSM;
    ?
     
  3. jesusluvsyooh

    jesusluvsyooh

    Joined:
    Jan 10, 2012
    Posts:
    377
    Check to make sure your 'build settings' is set to the Playstation Mobile platform, if you open a project from a different platform it defaults to 'web player' build :)
     
  4. spmonahan

    spmonahan

    Joined:
    Sep 13, 2014
    Posts:
    3
    Just double-checked, yes, I have "using UnityEngine.PSM;" at the top of my script. I also have the build settings correct as I can deploy to the Vita no problem.

    One other thing I have noticed is that I don't get code completion in MonoDevelop when editing scripts from the PSM version of Unity. If I use the regular, non-PSM version of Unity code completion works fine (though I don't have access to any of the PSM stuff there).
     
  5. spmonahan

    spmonahan

    Joined:
    Sep 13, 2014
    Posts:
    3
    I fixed this by reinstalling the PSM version of Unity. Looks like I didn't originally install the version of MonoDevelop that ships with Unity PSM and was instead using the standard Unity version of MonoDevelop.