Absolute beginner on Unity, trying out the new Input Actions system, pretty straightforward. However, I have two individual actions set up (MouseScrollUp, and MouseScrollDown) which are featured in my cameraController script. My goal on this is to zoom in and own with the zoom multiplier variable to be the interval the orthographic camera size to change. And for the scroll wheel to actually work. Here is my script.
using UnityEngine;
using UnityEngine.InputSystem;
public class CameraController : MonoBehaviour
{
private float zoom = 0f;
private float minZoom = 2f;
private float maxZoom = 100f;
public float zoomMultiplier = 1f;
public Camera cam;
private void Start()
{
zoom = cam.orthographicSize;
}
public void OnMouseScrollUp(InputValue value)
{
// Adjust zoom directly using zoomMultiplier
Debug.Log("scrolling up");
}
public void OnMouseScrollDown(InputValue value)
{
// Adjust zoom directly using zoomMultiplier
Debug.Log("scrolling down");
}
}
Now at the moment both methods for scrolling in and out just have a debug log setup so I can see what’s happening. And to put it in simpler terms, they both get called when attempting to scroll. I am not sure if an image correctly uploaded that shows the actions, but I can say, they are both Pass Through, Axis actions. Thanks!