Im using 2019.2.12f1
Sorry if I’m missing something dumb, I’m new to the Input System and only just getting a grip on it.
The InputAction is defined within a MonoBehaviour, and binding is set in the inspector. I will see if this happens in an ActionMap asset as well.
I’m trying to write a simple processor to smoothDamp() a Vector2. I copy-pasta’d Unity’s example of a custom processor and put my bit of code in. So it’s registering correctly etc (or at least how they say so as of yet).
My code worked fine (smoothing correctly, although a tad glitchy when the stick centers), and when I removed the processor from the Binding (via the inspector, editing the Mono), it disappeared from the processors list when I went to re-select it.
I commented out all my code, and simply returned the input value on Process() (in case it was my doing), but it didn’t pop back up.
There are no errors in the console.
It wasn’t untill I restarted my Editor it reappeared.
I can re-create this pretty successfully; if I remove it from the binding, it disappears. All the Unity ones seem okay.
Hopefully this formats right, but here’s the class. My code is left commented out just to rule it out, it disappearing exactly as you see it now. It is copy+paste of the example aside from my commented out bits.
using UnityEditor;
using UnityEngine;
using UnityEngine.InputSystem;
#if UNITY_EDITOR
[InitializeOnLoad]
#endif
public class SmoothVector2 : InputProcessor<Vector2>
{
//public float smoothCoef = 0.1f;
//private Vector2 _vector = new Vector2(0, 0), _vectorRef = new Vector2(0, 0);
#if UNITY_EDITOR
static SmoothVector2()
{
Initialize();
}
#endif
[RuntimeInitializeOnLoadMethod]
static void Initialize()
{
InputSystem.RegisterProcessor<SmoothVector2>();
}
public override Vector2 Process(Vector2 value, InputControl control)
{
//_vector = new Vector2(Mathf.SmoothDamp(_vector.x, value.x, ref _vectorRef.x, smoothCoef),
// Mathf.SmoothDamp(_vector.y, value.y, ref _vectorRef.y, smoothCoef));
// return _vector;
return value;
}
//...
}