I’ve been learning how to use the new Input System, but I can’t figure out how to handle mouse input. I want to have the camera rotate around the player, and to do that I need to get the X and Y of the mouse. In the old system it was already made for you, but I have no idea how to set that up in the new system. I can provide more info if needed.
Starting from the Player Input component makes this easier. It provides some default input action mappings that give you Movement, Look, and Fire for free. After that, you just have to use one of the notification approaches (e.g., unity events, C# events, etc.) to string up the events to your mouse look script.
you can use this method:
Vector3 MousePosition;
void Update()
{
MousePosition = Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x,Input.mousePosition.y,10f));
}
Okay I managed to fix it by going to the input action and checking on Generating C# Script
now I can reference the input action script in my script and get the value from it.
void Update()
{
mousePos = Camera.main.ScreenToWorldPoint(_input.mouse.Look.ReadValue());
}