I am trying to use Unity's new input system to simply read the mouse position. I created a StandardMap InputActionMap asset, with a CursorPosition InputAction configured to read the mouse position ("Value & Vector2" action).
I should be able to read the value of the mouse using something like:
Vector2 pointerPosition =
theInputMapAsset.FindActionMap("StandardMap").FindAction("CursorMovement").ReadValue<Vector2>();
Unfortunately, pointerPosition always returns 0,0! I tried everything and it doesn't seem to work...
EDIT: This situation happens, it turns out, if you have no PlayerInput component that defines a default input handler as noted in: https://docs.unity3d.com/Packages/com.unity.inputsystem@1.0/manual/Components.html
The answer below does still apply, as it correctly warns that an input map must be explicitly enabled if there is no player input component.