#How do I get the inputs of my InputController thing?

1 messages · Page 1 of 1 (latest)

echo sleet
#

So I want to know when the player is moving the mouse.I followed tutorials and I dont know how to get the inputs(New Input System).In this image you see my configuration for the thing but I dont know how to acces its inputs throught a script.So how do I get the inputs?😐

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;

//--Writing space--//
public class CameraRotation : MonoBehaviour
{
    //--Public Variables--//
    public GameObject Player;
    public InputActionAsset PlayerInput;
    [Space]
    public float ZoomMax = 10;


    //--Private Variables--//

    private float ZoomMin = 0;

    private void OnEnable()
    {
        PlayerInput.Enable();
    }
    private void OnDisable()
    {
        PlayerInput.Disable();
    }

    private void OnCameraMovement()
    {
        Debug.Log("Camera Is Moving");
    }
}```
stone grove
#

there are several methods

#

you could use the asset, sure, but that requires using magic strings to get the specific actions, i don't recommend magic strings

#

though tbf PlayerInput with messages is kinda similar

echo sleet
# stone grove

What does that mean ...?I tried changing it to InputActionReference but it still doesnt work?

#

I started Unity yesterday

#

So when the right button is held and the mouse is dragged I should get an input?

#

But it doesnt printing anything.

#

Ah so I dont post problems here

#

Well post closed

stone grove
#

man, i don't have infinite free time and i don't get notifs if you close the thread lmao

stone grove
pulsar olive
echo sleet
#

I managed to get it working

echo sleet
#

I dont know what I have to subscribe to but I fixed my code