PSM MissingMethodException in Sce.PlayStation.Core.dll

I just downloaded the new PSM Unity beta and the newest PSM sdk and have been trying to get code for input from the Vita to work. Everything builds fine in Mono but when I try and run the game in Unity, I get the following error:

MissingMethodException: Cannot find the requested method.
Sce.PlayStation.Core.Input.GamePad.GetData (Int32 deviceIndex)

I have added the dll to my project and it is visible in both Unity and monodevelop. I have tried switching the API Compatibility Level from 2.0 Subset to 2.0 and renaming the dll but those attempts did nothing. I am not sure what else I should try.

Here is my code:

using UnityEngine;
using System.Collections;
using Sce.PlayStation.Core.Input;

public class ThirdPersonCamera : MonoBehaviour
{
	void Start()
	{
		
	}
	
	void FixedUpdate ()
	{
        var gamePadData = GamePad.GetData(0);
		transform.position += transform.forward * 2f * gamePadData.AnalogLeftY;
	}
}

The call to GamePad.GetData(0) is what cannot be found.

Thanks for any help!

You can’t use the PSM SDK libraries in Unity (like Sce.PlayStation.Core.Input etc), you have to use Unity’s own Input class and the key and axis assignements here. So for your example you would set up the Y axis in the Unity Input Manager, give it a name, such as “LeftStickVitaY”, then use:

transform.position += transform.forward * 2f * Input.GetAxis("LeftStickVitaY");

As a side note, you possibly want to be doing movement stuff in Update() and multiplying by Time.deltaTime to get smooth motion, rather than using FixedUpdate().