I am having trouble with the new input system. My game already has an inputactions file I would like to also use for dialogue system, but I must be missing a step because my script is throwing errors.
My file has an action map called UI with UI inputs. (It's messy right now.)
Screenshot 2023-06-30 124437.png (23.96 KiB) Viewed 1446 times
My event system is pointing at this file. Dialogue Manager has InputDeviceManager attached. I have a script attached called RollerDSInputRegistration.cs, and this is the content:
using UnityEngine;
namespace PixelCrushers.DialogueSystem
{
/// <summary>
/// This class helps the Dialogue System's demo work with the New Input System. It
/// registers the inputs defined in DemoInputControls for use with the Dialogue
/// System's Input Device Manager.
/// </summary>
public class RollerDSInputRegistration : MonoBehaviour
{
#if USE_NEW_INPUT
private RollerDSInputRegistration controls;
// Track which instance of this script registered the inputs, to prevent
// another instance from accidentally unregistering them.
protected static bool isRegistered = false;
private bool didIRegister = false;
void Awake()
{
controls = new RollerDSInputRegistration();
}
void OnEnable()
{
if (!isRegistered)
{
isRegistered = true;
didIRegister = true;
controls.Enable();
InputDeviceManager.RegisterInputAction("Horizontal", controls.UI.Horizontal);
InputDeviceManager.RegisterInputAction("Vertical", controls.UI.Vertical);
InputDeviceManager.RegisterInputAction("Fire1", controls.UI.Fire1);
}
}
void OnDisable()
{
if (didIRegister)
{
isRegistered = false;
didIRegister = false;
controls.Disable();
InputDeviceManager.UnregisterInputAction("Horizontal");
InputDeviceManager.UnregisterInputAction("Vertical");
InputDeviceManager.UnregisterInputAction("Fire1");
}
}
#endif
}
}
Screenshot 2023-06-30 124437.png (23.96 KiB) Viewed 1446 times
Am I missing something? Thanks!
Attachments
Screenshot 2023-06-30 130739.png (28 KiB) Viewed 1446 times
Assets\Plugins\Pixel Crushers\Dialogue System\Demo\Scenes\New Input System\RollerDSInputRegistration.cs(16,25): error CS0246: The type or namespace name 'RollerGirlInputs' could not be found (are you missing a using directive or an assembly reference?)
Does the generated CS class need to be in a specific place to be found by the script?
Action has been triggered but apparently not from an interaction yet there's interactions on the binding that got triggered?!?
UnityEngine.InputSystem.InputActionAsset:Disable ()
RollerGirlInputs:Disable () (at Assets/_George/RollerMovement/RollerGirlInputs.cs:1324)
PixelCrushers.DialogueSystem.RollerDSInputRegistration:OnDisable () (at Assets/_George/RollerMovement/RollerDSInputRegistration.cs:47)
What is the name of the Interact action? "Interact"? If so, did you register "Interact" in your RollerDSInputRegistration script and also set the Proximity Selector's Use Button to "Interact"?