0

I'm having trouble understanding how the "IPointer" (IPointerDownHandler, IPointerMoveHandler, IPointerUpHandler, IPointerClickHandler) interfaces are supposed to work with the New Input System.

Here is my monobehavior attached to a gameobject in my scene:

public class TextHandler : MonoBehaviour, IPointerDownHandler, IPointerMoveHandler, IPointerUpHandler, IPointerClickHandler
{  
  public void OnPointerDown(PointerEventData eventData)
  {
      throw new System.NotImplementedException();
  }

  public void OnPointerMove(PointerEventData eventData)
  {
      throw new System.NotImplementedException();
  }

  public void OnPointerUp(PointerEventData eventData)
  {
      throw new System.NotImplementedException();
  }

  public void OnPointerClick(PointerEventData eventData)
  {
      throw new System.NotImplementedException();
  } 
}

I expect this to log errors to the console whenever I move or click the mouse, but nothing seems to happen at all - as if these unity messages (i assume) are not being sent at all?

Hovering over these interfaces tells me the following.

Interface to implement if you wish to receive OnPointerMove callbacks.

Criteria for this event is implementation dependent. For example see StandAloneInputModule.

Adding a StandAloneInputModule to an object in my scene gives the following UI warning, telling my that the StandAloneInputModule is a part of the old input system, and giving me a button to replave it with a InputSystemUIInputModule, which I already have in my scene.

enter image description here

I am using the unity 6.4 standard (New Input System) InputSystem_Actions map, which has UI point and click controls set up by default

enter image description here

Here is my InputSystemUIInputModule, also with default values. enter image description here

And my EventSystem on the same object. enter image description here

I can't find anywhere that states that these interfaces/methods are deprecated or are unsuported with the New Input System, is there some way I'm using this wrong?

7
  • They aren't deprecated .. and yes! These UI actions are exactly what you need. But then in your EventSystem on the according InputSystemUIInputModule you also need to make sure they are all assigned correctly Commented Mar 29 at 19:08
  • @derHugo image of my InputSystemUIInputModule added, along with my EventSystem. They are all with default values but I can't see what would be wrong with them? Commented Mar 29 at 19:23
  • Only obscure thing i can think of is are the items marked not raycast target? Commented 2 days ago
  • @BugFinder these should be firing every time the mouse moves so I don't see how that could be it ;/ Commented 2 days ago
  • @Jay if the raycast doesn't hit something then the events are not fired .. it's a good guess because besides that I don't really see why the approach would not work as expected. Another might be: are these objects part of a Canvas or 3D/2D collider objects? In the first case there needs to be a GraphicsRaycaster on the Canvas including according layer(s). In the second(or third) cases there needs to be a Physics(2D)Raycaster attached to the Camera Commented 2 days ago

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.