Skip to main content
Don't use bold formatting and skip the class declaration, just put the whole file in a code block
Source Link
DMGregory
  • 140.8k
  • 23
  • 257
  • 401

I'm trying to use the new input system for my 3rd person character in Unity. However, whenever I press the WASD keys, or try to move the camera, nothing happens. I've looked everywhere, but can't find an answer!

Here's a picture of the different values and such. enter image description here

Here's some of my code

using UnityEngine; using UnityEngine.InputSystem;

[Header("Mouse Input Settings")]
public bool cursorLocked = true;
public bool cursorInputForLook = true;

public void OnMove(InputValue value)
{
    Debug.Log("Moving");
    move = value.Get<Vector2>();
}


public void OnLook(InputValue value)
{

    Debug.Log("Looking");
    if (cursorInputForLook)
    { 
       look = value.Get<Vector2>();
        
    }
}

public void OnJump(InputValue value)
{
    Debug.Log("Jumping");
    jump = value.isPressed;
}

public void OnSprint(InputValue value)
{
    Debug.Log("Sprinting");
    sprint = value.isPressed;
}
using UnityEngine;
using UnityEngine.InputSystem;

public class CharacterController : MonoBehaviour {

    [Header("Mouse Input Settings")]
    public bool cursorLocked = true;
    public bool cursorInputForLook = true;

    public void OnMove(InputValue value)
    {
        Debug.Log("Moving");
        move = value.Get<Vector2>();
    }

    
    public void OnLook(InputValue value)
    {

        Debug.Log("Looking");
        if (cursorInputForLook)
        { 
           look = value.Get<Vector2>();
            
        }
    }

    public void OnJump(InputValue value)
    {
        Debug.Log("Jumping");
        jump = value.isPressed;
    }

    public void OnSprint(InputValue value)
    {
        Debug.Log("Sprinting");
        sprint = value.isPressed;
    }
}

I also have the active input handling turned to both input systems in the projected settings menu. What could I possibly be doing wrong? Is my project just bugged, and I have to just make a new one? Any help would be appreciated!

I'm trying to use the new input system for my 3rd person character in Unity. However, whenever I press the WASD keys, or try to move the camera, nothing happens. I've looked everywhere, but can't find an answer!

Here's a picture of the different values and such. enter image description here

Here's some of my code

using UnityEngine; using UnityEngine.InputSystem;

[Header("Mouse Input Settings")]
public bool cursorLocked = true;
public bool cursorInputForLook = true;

public void OnMove(InputValue value)
{
    Debug.Log("Moving");
    move = value.Get<Vector2>();
}


public void OnLook(InputValue value)
{

    Debug.Log("Looking");
    if (cursorInputForLook)
    { 
       look = value.Get<Vector2>();
        
    }
}

public void OnJump(InputValue value)
{
    Debug.Log("Jumping");
    jump = value.isPressed;
}

public void OnSprint(InputValue value)
{
    Debug.Log("Sprinting");
    sprint = value.isPressed;
}

I also have the active input handling turned to both input systems in the projected settings menu. What could I possibly be doing wrong? Is my project just bugged, and I have to just make a new one? Any help would be appreciated!

I'm trying to use the new input system for my 3rd person character in Unity. However, whenever I press the WASD keys, or try to move the camera, nothing happens. I've looked everywhere, but can't find an answer!

Here's a picture of the different values and such. enter image description here

Here's some of my code

using UnityEngine;
using UnityEngine.InputSystem;

public class CharacterController : MonoBehaviour {

    [Header("Mouse Input Settings")]
    public bool cursorLocked = true;
    public bool cursorInputForLook = true;

    public void OnMove(InputValue value)
    {
        Debug.Log("Moving");
        move = value.Get<Vector2>();
    }

    
    public void OnLook(InputValue value)
    {

        Debug.Log("Looking");
        if (cursorInputForLook)
        { 
           look = value.Get<Vector2>();
            
        }
    }

    public void OnJump(InputValue value)
    {
        Debug.Log("Jumping");
        jump = value.isPressed;
    }

    public void OnSprint(InputValue value)
    {
        Debug.Log("Sprinting");
        sprint = value.isPressed;
    }
}

I also have the active input handling turned to both input systems in the projected settings menu. What could I possibly be doing wrong? Is my project just bugged, and I have to just make a new one? Any help would be appreciated!

Source Link

New Unity input system not working/responding

I'm trying to use the new input system for my 3rd person character in Unity. However, whenever I press the WASD keys, or try to move the camera, nothing happens. I've looked everywhere, but can't find an answer!

Here's a picture of the different values and such. enter image description here

Here's some of my code

using UnityEngine; using UnityEngine.InputSystem;

[Header("Mouse Input Settings")]
public bool cursorLocked = true;
public bool cursorInputForLook = true;

public void OnMove(InputValue value)
{
    Debug.Log("Moving");
    move = value.Get<Vector2>();
}


public void OnLook(InputValue value)
{

    Debug.Log("Looking");
    if (cursorInputForLook)
    { 
       look = value.Get<Vector2>();
        
    }
}

public void OnJump(InputValue value)
{
    Debug.Log("Jumping");
    jump = value.isPressed;
}

public void OnSprint(InputValue value)
{
    Debug.Log("Sprinting");
    sprint = value.isPressed;
}

I also have the active input handling turned to both input systems in the projected settings menu. What could I possibly be doing wrong? Is my project just bugged, and I have to just make a new one? Any help would be appreciated!