Edit: I just saw on this forum, there is a page for input system, My too damaged brain saw it too late…
Edit2: it worked fine after restarting Unity… but now, after restarting Unity again, the bug has returned. … no clue what’s going on with this new Input System.
It is a fairly new project with very few in it, did a simple movement script with the new Input System and suddenly:
Cannot find action map ‘GamePlay’ in actions ‘Inputs (UnityEngine.InputSystem.InputActionAsset)’
UnityEngine.InputSystem.PlayerInput:OnEnable () (at Library/PackageCache/com.unity.inputsystem@1.3.0/InputSystem/Plugins/PlayerInput/PlayerInput.cs:1620)
Where does this so called ‘GamePlay’ come from?.. I never created anything in this project called ‘Gameplay’ and now after this error message. the Input system broke and my player moves on own accord now. WASD are pressed down and set on .56f on both axis even though i don’t touch the keyboard.
my movement script: Inputs is reference to the generated C# script from my Input Asset
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
public class PlayerController : MonoBehaviour
{
Inputs playerControlls;
InputAction move, look;
[SerializeField] float speed = 10;
[SerializeField] float maxSpeed;
[SerializeField] float rotationSpeed = 450;
Rigidbody rb;
Vector3 input;
Quaternion toRoatation;
Plane plane = new (Vector3.up, Vector3.zero);
private void Awake()
{
playerControlls = new Inputs();
rb =GetComponent<Rigidbody>();
}
private void Update()
{
input = new Vector3(move.ReadValue<Vector2>().x, 0, move.ReadValue<Vector2>().y);
print(input);
}
private void FixedUpdate()
{
rb.velocity += input.normalized * (speed * Time.fixedDeltaTime);
rb.velocity = Vector3.ClampMagnitude(rb.velocity, maxSpeed);
Ray ray = Camera.main.ScreenPointToRay(Mouse.current.position.ReadValue());
if (plane.Raycast(ray, out var enter))
{
var hitpoint = ray.GetPoint(enter);
var dir = hitpoint - transform.position;
toRoatation = Quaternion.LookRotation(dir);
transform.rotation = Quaternion.RotateTowards(transform.rotation, toRoatation, rotationSpeed * Time.fixedDeltaTime);
}
}
private void OnEnable()
{
move = playerControlls.Player.Move;
look = playerControlls.Player.Look;
move.Enable();
look.Enable();
}
private void OnDisable()
{
move.Disable();
look.Disable();
}
}