- Home /
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!
If you declare gamePadData
to have type GamePadData
does that help? I've not used PS$$anonymous$$ but wonder if it's just the compiler is confused looking for the right function.
No that didn't work.. $$anonymous$$aybe something is wrong with my environment...
Answer by Nine · May 12, 2014 at 02:05 PM
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().
Your answer
Follow this Question
Related Questions
Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers
Equality and Inequality operators not found in DLL ??? 1 Answer
Custom DLL - MissingMethodException: string[] string.Split 3 Answers
'EventSystems' does not exist in the namespace 'UnityEngine'... 1 Answer