Sunday, November 2, 2025
spot_img

Cannot Get Unity New Enter System To Work


For context I’m very a lot a newbie.

I’ve been attempting to get the participant to maneuver utilizing Unity’s new Enter System following this tutorial. It is solely a yr previous and others within the feedback appeared to have figured it out okey; some individuals have had troubles like me although. I adopted the tutorial once more very carefully and couldn’t see that I did something fallacious. I’ve beforehand been in a position to make use of Unity’s previous Enter System properly however by no means tried this one.

I opened and closed Unity, and uninstalled after which reinstalled the brand new Enter system. I made certain that the settings had been set to make use of each legacy and new Enter.

I’m not receiving any errors within the script or console.

Screenshot of settings:

Cannot Get Unity New Enter System To Work

Code:

utilizing UnityEngine;
utilizing UnityEngine.InputSystem;

public class PlayerMovement : MonoBehaviour
{
    personal float moveSpeed = 5;
    personal Rigidbody2D rb;
    personal Vector2 moveInput;

    // Begin is known as as soon as earlier than the primary execution of Replace after the MonoBehaviour is created
    void Begin()
    {
        rb = GetComponent<Rigidbody2D>();
        
    }

    // Replace is known as as soon as per body
    void Replace()
    {
        rb.linearVelocity = moveInput * moveSpeed;
      
    }

    public void Transfer(InputAction.CallbackContext context)
    {
        Debug.Log("Perform referred to as.");
        moveInput = context.ReadValue<Vector2>();

    }
}
 

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisement -spot_img

Latest Articles